Category : debugging

I am writing a unittest for a python script which does heavy file operations via os and hence I mocked some of the os functions. I noticed a strange behavior when patching the return value of os.path to return False via: @pytest.fixture(autouse=True) def init_mocks(monkeypatch): monkeypatch.setattr( mymodule.os.path, "exists", Mock(return_value=False)) My debugger (within VSCode) does not work ..

Read more

I cant seem to debug this invalid syntax error. name = input("Hello There Welcome to the School Age Calculation System proudly brought to you by Hi-Tek Labs. Enter your name to start") print("Why Hello There" + name) def age(): pass age = input(name + ("What is your age") if age < 5 print("You are not ..

Read more

I have a python library (module) that contains multiple modules and associated tests following a fairly standard structure project_root library_folder __init__.py module_A __init__.py sub_module_AA __init__.py file_AAA.py file_AA.py file_AB.py file_AC.py module_B __init__.py file_BA.py file_BB.py module_C __init__.py file_CA.py file_CB.py file_CC.py … tests module_A test_fileAA.py … module_B test_fileBA.py … pyproject.toml … Currently I am doing what I would ..

Read more