From d37e7088d329a76b8e4ef54304e2ec07ffccfcdf Mon Sep 17 00:00:00 2001 From: apanayotova03 Date: Thu, 27 Jun 2024 18:41:31 +0200 Subject: [PATCH] Update test_init.py Test 2 --- testing/code/test_init.py | 41 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/testing/code/test_init.py b/testing/code/test_init.py index 39695f6e6..6cf11a2ec 100644 --- a/testing/code/test_init.py +++ b/testing/code/test_init.py @@ -77,6 +77,7 @@ from _pytest.config import Config from _pytest.config.__init__ import create_terminal_writer from _pytest.config.__init__ import Config from _pytest.config.__init__ import _strtobool +import pytest if TYPE_CHECKING: @@ -109,36 +110,14 @@ tw = create_terminal_writer(config) assert tw.hasmarkup == False assert tw.code_highlight == False +# # Test branch 1 in _strtobool +# assert _strtobool("y") == True -assert _strtobool("y") == True -assert _strtobool("n") == False -print("%d", _strtobool("a")) +# # Test branch 2 in _strtobool +# assert _strtobool("n") == False - - - -# self = PytestPluginManager() - -# # Test branches 1,3,4 in consider_pluginarg -# print("Given input: no:cacheprovider") -# self.consider_pluginarg("no:cacheprovider") - -# assert name == "cacheprovider" -# assert self._name2plugin[name] == None -# assert self.set_blocked == "stepwise" -# assert self.set_blocked == "pytest_stepwise" -# assert self.set_blocked == "pytest_" + name - -# # Test branches 5,6 in consider_pluginarg -# arg = "mark" -# something.consider_pluginarg("mark") -# assert name == "mark" -# assert self.unblock == "pytset_" + name -# assert consider_entry_points == True - -# # Test branches 1,2,4 in consider_pluginarg -# arg = "no:mark" -# something.consider_pluginarg("no:mark") -# assert name == "mark" -# assert self.set_blocked == "pytest_" + name - \ No newline at end of file +# # Test branch 3 in _strtobool +# with pytest.raises(ValueError) as excinfo: +# _strtobool("a") + +# assert str(excinfo.value) == "invalid truth value 'a'"