Quiz Space

Modern Application Development I · End Term · 13 Apr 2025 · January 2025 term · Set QDD3

Question 17: You are given a project with three files: conftest.py, t…

Question 17

+4.5 marksOne correct option

You are given a project with three files: conftest.py, test_multiples_of_3_and_6.py, and test_multiples_of_13.py. The purpose of the tests is to verify if numbers generated by each function are divisible by 39. However, there is a setup issue in this project.

  • conftest.py contains a fixture that provides test data.
  • test_multiples_of_3_and_6.py has two functions: one checks divisibility by 3, and the other by 6.
  • test_multiples_of_13.py contains a function to check divisibility by 13.

Here is the content of each file:

conftest.py

python
import pytest
@pytest.fixture
def divisible_by_39():
return 39 # Fixture providing the number to be tested

test_multiples_of_3_and_6.py

python
import pytest
def test_divisible_by_3(divisible_by_39):
assert divisible_by_39 % 3 == 0 # Checks if divisible by 3
def test_divisible_by_6(divisible_by_39):
assert divisible_by_39 % 6 == 0 # Checks if divisible by 6

test_multiples_of_13.py

python
import pytest
def test_divisible_by_13(divisible_by_39):
assert divisible_by_39 % 13 == 0 # Checks if divisible by 13

When you run pytest -k divisible , which of the following is true?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Video solution

The video solution to this question is being recorded and will play here. Until then, the answer key is above.

Question 17 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD3 13 Apr 2025). It carries 4.5 marks.

More questions from this paper

  1. Q1A certain text document consisting of only alphanumeric characters (including spaces) takes 320000 bits, when encoded w…
  2. Q2Which of the following is true about the term “stateful” in the client-server model?
  3. Q3Consider the following git branches for a remote repository.
  4. Q4The Quiz Master application at IITM BS allows students to attempt quizzes online. To prevent automated bots from mass-s…
  5. Q5A mobile client starts from and is cruising away continuously at 120 kmph from the network tower whose network range is…
  6. Q6Consider the code below in a file called test_students.py test_students.py Which of these is the correct output when th…
  7. Q7Consider the following models Department and Student corresponding to tables department and student in SQLite database.…
  8. Q8Consider the following statements and choose the correct option\ Statement 1: It is always mandatory to implement serve…
  9. Q9Figure question
  10. Q10Consider the following example: Which of the following accessibility principles is followed in this example?
  11. Q11Figure question
  12. Q12Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  13. Q13Consider the following Python code. File name: main.py What will be the output, when running the above code using the c…
  14. Q14Consider the following Python code File name: main_test.py What will be the output of running the above python script u…
  15. Q15Consider the schema for the Class Student. What will be the output of the flask_sqlalchemy command given below?
  16. Q16Consider the following flask application "app.py" given below. If the application is running locally on http://127.0.0.…
  17. Q18A client machine and a server machine located 120 kilometers apart start moving towards each other along a straight lin…
  18. Q19Which of the following are benefits of using the MVC (Model-View-Controller) architecture?
  19. Q20Consider the following Python code. Which of the following statement(s) should replace ==Missing code here=== so that i…
  20. Q21Which of the following statements about server architectures, Apache and Nginx, is/are correct?
  21. Q22Consider the following route in the flask for a signup page and select the correct option:
  22. Q23Consider the following HTML code.
  23. Q24Consider the following Flask app code. The above flask app is running on “http://127.0.0.1:5000”. Which of the followin…
  24. Q25Consider the following Jinja2 templating code: Will the above Jinja templating code return the correct output? If yes, …
  25. Q26The following Flask-RESTful API code snippet is intended to create a RESTful API for managing student registrations in …
  26. Q27IITM BS degree program conducts an annual event called Paradox every summer. The event is open to students, and partici…
  27. Q28IITM BS degree program conducts an annual event called Paradox every summer. The event is open to students, and partici…
  28. Q29The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the …
  29. Q30The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the …
  30. Q31Which of the following storage types should be used for storing frequently accessed small student records that need low…
  31. Q32The college wants to store archived counseling records from past students for future reference. These records are rarel…