Skip to content

Commit

Permalink
tests: comment out unnecessary file spoof
Browse files Browse the repository at this point in the history
The libraryloader is now written in a way that it tries to access
`__file__` only if there is an actual need. Since we are merely working
with system libraries or absolute libpaths in the test suite, this is
not the case.
  • Loading branch information
mara004 committed Feb 19, 2024
1 parent fd4eeb8 commit c6ce94f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def ctypesgen_main(args, echo=True):
return ctypesgen.__main__.main(args)

def module_from_code(name, python_code):
file_spoof = f"__file__ = '{TEST_DIR/'spoof.py'}'\n\n"
python_code = file_spoof + python_code
# file_spoof = f"__file__ = '{TEST_DIR/'spoof.py'}'\n\n"
# python_code = file_spoof + python_code
module = types.ModuleType(name)
exec(python_code, module.__dict__)
return module
Expand Down

0 comments on commit c6ce94f

Please sign in to comment.