Quiz Space

Modern Application Development I · End Term · 1 Sept 2024 · May 2024 term · Set QDF1

Question 28: Consider the following function to be tested and test fu…

Question 28

+4.5 marksOne or more correct options

Consider the following function to be tested and test functions given in the Python code snippet below.

test_file.py

python
import pytest
def square(x):
sum = 0
for counter in range(x):
sum += x
return sum
@pytest.mark.marker1
def testcase_1():
assert square(10) == 100
@pytest.mark.marker2
def testcase_2():
assert square(4) == 4
@pytest.mark.marker3
def testcase_3():
assert square(5) == 25
@pytest.mark.marker4
def testcase_4():
assert square(6) == 6

On running this file on the terminal using pytest, the summary of the output is;

text
========= 1 passed, 3 deselected, 4 warnings in 0.04s =========

What command will result into the outcome given above?

Select all that apply.

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

Correct answers

  • A
  • C

Question 28 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 1 Sept 2024, in the May 2024 term (IIT M FOUNDATION DIPLOMA AN EXAM QDF3 01 Sep 2024). It carries 4.5 marks.

More questions from this paper

  1. Q1Consider the following Python code snippet.
  2. Q2Consider the following HTML document. How will the browser render above HTML file?
  3. Q3Consider the following flask application.
  4. Q4Figure question
  5. Q5Consider a function func, and a set of test cases given below. Filename: test_file.py What will be the output on the te…
  6. Q6The lens of an HDD can read data on the rotating disk with the speed of 42,000 bits per second. The disk is designed su…
  7. Q7Consider the below two python files code snippets app.py and test_app_route.py. app.py test_app_route.py: Assume that a…
  8. Q8Consider the following flask resource created using flask_restful. If the application is running locally on http://127.…
  9. Q9A flask application shown below is running locally on http://127.0.0.1:5000. If the application is running locally on h…
  10. Q10Consider the following flask application. Python file: app.py Template file: profile.html If the application is running…
  11. Q11Consider the following models Library and Book corresponding to tables library and book in SQLite database. Based on th…
  12. Q12Read the statements given below carefully and select the correct option.\ Statement 1:If an element having an ID and a …
  13. Q13Consider the following Python code snippet. log.py What will be the output on the terminal for the command: python log.…
  14. Q14Consider the following graph that represents the variation in bandwidth of a network for an entire day (24 hours). Thre…
  15. Q15Consider the below flask application. If you run the flask application using a terminal. What will be the output in the…
  16. Q16Figure question
  17. Q17Consider the following flask app and Jinja2 template. app.py index.html If the flask app is running locally on http://1…
  18. Q18Figure question
  19. Q19Consider the following python code snippet app.py, the HTML files, base.html and home.html residing in “templates” fold…
  20. Q20You have a DRAM module with bus width of 64 bits, clock speed of 2 GHz, and operating in DDR (double-data-rate or two v…
  21. Q21Figure question
  22. Q22Which of the following is true about the term “stateless” in the client-server model?
  23. Q23Consider the following Python code snippet “code.py”. Filename: code.py Which of the following will be the correct comm…
  24. Q24Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  25. Q25Consider the following flask application. If the application is running locally on http://127.0.0.1:5000 then which of …
  26. Q26Consider the following flask_sqlalchemy data models “User” and “Role”. python shell: If the above commands are run in t…
  27. Q27Suppose a request https://xyz.com?name=amey&age=34 generates the below response on the browser’s console, The definitio…
  28. Q29Consider the following flask application. If the application is running locally on http://127.0.0.1:5000, select the co…
  29. Q30Consider the following code snippet. Assume the database has a "student" table which has a TEXT column "student_id". If…
  30. Q31Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…
  31. Q32Consider the following flask application running locally on http://127.0.0.1:5000 app.py Based on the above data, answe…