boxed / hammett

Fast python test runner, compatible with a subset of pytest
BSD 3-Clause "New" or "Revised" License
79 stars 7 forks source link

Support for fixtures in conftest.py #13

Open jakob-herpel-by opened 3 years ago

jakob-herpel-by commented 3 years ago

Hi, thank you for the cool project.

Would it be possible to add support for fixtures specified in conftest.py that are imported magically by pytest?

Greetings

Jakob

boxed commented 3 years ago

So these would be fixtures that would be set up once per session and then never explicitly used? Kind of like on a module level using mark.use_fixtures?

hmvp commented 3 years ago

Or fixtures that needs to be reused across different tests (modules) and are explicitly used...

kronenpj commented 3 years ago

I found a workaround by running hammett as follows: hammett tests/conftest.py tests/ This allows the fixtures in tests/conftest.py to be noticed and are run as expected.

JamieMcKernanKaizen commented 2 years ago

@boxed @kronenpj The workaround did not work for me - I still got

test_something() missing 3 required positional arguments: 'monkeypatch', 'mock_filesystem', and 'repository'
boxed commented 2 years ago

I'll happily accept a PR. The support for conftest.py is in load_plugins() which is a tiny little function. As you can see it doesn't do much right now.