Courseiva

PCPP2 · topic practice

Software Testing practice questions

Practise Python Institute Certified Professional in Python Programming 2 (PCPP2) (PCPP2) Software Testing practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Reviewed byJohnson Ajibi· MSc IT Security
20 questionsDomain: Software Testing

What the exam tests

What to know about Software Testing

Software Testing questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Software Testing exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Practice set

Software Testing questions

20 questions · select your answer, then reveal the explanation

Which of these is NOT a naming convention for discovery in pytest?

In pytest, how can you skip a test based on the operating system platform?

Question 3mediummultiple choice
Read the full Software Testing explanation →

Which 'unittest' assertion is best suited to verify that two floating-point numbers are equal within a certain tolerance?

You need to mock an object that is imported into a module. Which patch strategy correctly replaces the object where it is used?

When using the 'unittest' framework, which method is executed exactly once before any test methods in a class are run?

In 'unittest.mock', when you want to return a specific value based on the input arguments of a mocked function, which property should be configured?

Question 7mediummultiple choice
Read the full Software Testing explanation →

You are refactoring a legacy module and want to use 'pytest' to check if a function raises a specific custom exception. Which construct is most idiomatic?

Question 8mediummultiple choice
Read the full Software Testing explanation →

You are writing a pytest fixture that opens a database connection. Which scope should you use to ensure the connection is created once per module, rather than once per test function?

Question 9mediummultiple choice
Read the full Software Testing explanation →

When using 'unittest.mock.MagicMock', what happens when you access an attribute that hasn't been defined?

What command-line flag is used in pytest to stop the test suite execution after the first failure?

Which pytest feature allows you to run the same test multiple times with different sets of inputs?

Question 12mediummultiple choice
Read the full Software Testing explanation →

When using 'unittest', how do you ensure that a teardown method runs even if the test method raises an exception?

Which of the following is a valid way to run all tests in a directory using pytest?

Question 14mediummultiple choice
Read the full Software Testing explanation →

In pytest, how can you share a fixture across multiple files?

You are writing a pytest plugin and need to access the command-line options. Which hook should you implement in conftest.py?

When asserting that a mock was called with specific arguments, which method should be used to verify the call history?

Question 17mediummultiple choice
Read the full Software Testing explanation →

What is the purpose of the 'autospec' argument in 'patch'?

Question 18mediummultiple choice
Read the full Software Testing explanation →

How do you check how many times a mock object was called?

Question 19mediummultiple choice
Read the full Software Testing explanation →

What is the purpose of 'pytest.mark.xfail'?

Which TWO of the following are valid ways to pass data into a pytest test function?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Software Testing sessions

Start a Software Testing only practice session

Every question in these sessions is drawn from the Software Testing domain — nothing else.

Related practice questions

Related PCPP2 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the PCPP2 exam test about Software Testing?
Software Testing questions test whether you can apply the concept in context, not just recognise a definition.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Software Testing questions in a focused session?
Yes — the session launcher on this page draws every question from the Software Testing domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other PCPP2 topics?
Use the topic links above to move to related areas, or go back to the PCPP2 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the PCPP2 exam covers. They are not copied from any real exam or dump site.