mintel / pytest-localstack

Pytest plugin for local AWS integration tests
MIT License
78 stars 17 forks source link

Use pytest_configure instead of pytest.config #17

Closed ghost closed 5 years ago

ghost commented 5 years ago

@jtdoepke This is the same as charlies, but with pytest_configure because it's a plugin rather than using request

charlieparkes commented 5 years ago

Makes sense, as this is the recommended method in the documentation. I'll close #14

codecov[bot] commented 5 years ago

Codecov Report

Merging #17 into master will decrease coverage by 0.7%. The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #17      +/-   ##
=========================================
- Coverage    59.3%   58.6%   -0.71%     
=========================================
  Files          10      10              
  Lines         634     645      +11     
=========================================
+ Hits          376     378       +2     
- Misses        258     267       +9
Impacted Files Coverage Δ
pytest_localstack/__init__.py 38.77% <38.88%> (-6.23%) :arrow_down:
pytest_localstack/contrib/botocore.py 71.29% <66.66%> (-0.21%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9bb9393...ae14972. Read the comment docs.

jtdoepke commented 5 years ago

@LiamCato2 I added some review comments.

ghost commented 5 years ago

I get an error trying pytest -p no:pytest-localstack -k test_README.

>   timeout_remaining = timeout - (time.time() - start_time)
E   TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'

I think we need to add

if config.pluginmanager.hasplugin("pytest-localstack"):
    pytest.skip("skipping because pytest-localstack plugin isn't loaded")

to __init__.py:_fixture().

I've added a check for the -p flag disabling the plugin, so you can now use either (with a depreciation warn on the custom flag).