Skip to content

Commit

Permalink
Fix issue with pytest_cmdline_preparse
Browse files Browse the repository at this point in the history
The pytest_cmdline_preparse hook is now deprecated. I think there should
be a way to achieve the same effect using pytest_load_initial_conftests

https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest.hookspec.pytest_cmdline_preparse

However, were were using this to hook to prevent *.pyc and __pycache__
files from being generated. I think it is fine for now to just go back
to generating these files.
  • Loading branch information
cbatten committed Dec 9, 2024
1 parent 4b3bc18 commit eea5ff4
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pytest_plugin/pytest_pymtl3.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ def pytest_configure(config):
def pytest_unconfigure(config):
pass

def pytest_cmdline_preparse(config, args):
"""Don't write *.pyc and __pycache__ files."""
import sys
sys.dont_write_bytecode = True

def pytest_runtest_setup(item):
if _any_opts_present(item.config) and 'cmdline_opts' not in item.fixturenames:
pytest.skip("'cmdline_opts' is required by pytest commandline but not used")
Expand Down

0 comments on commit eea5ff4

Please sign in to comment.