XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
754 stars 191 forks source link

Add strict markers option for pytest #536

Closed antalszava closed 2 years ago

antalszava commented 3 years ago

Context: TBD Description of the Change: TBD Benefits: TBD Possible Drawbacks: TBD Related GitHub Issues: TBD

Raises the following error if no custom marker was specified for a test case:

Strawberry Fields marker specified for the test function:  <Function test_chop_in_blocks_multi[1]>
collected 8095 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/anaconda3/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
(...)
INTERNALERROR>     item.add_marker('dummy_strawberry_fields_marker')
INTERNALERROR>   File "/anaconda3/lib/python3.8/site-packages/_pytest/nodes.py", line 274, in add_marker
INTERNALERROR>     marker_ = getattr(MARK_GEN, marker)
INTERNALERROR>   File "/anaconda3/lib/python3.8/site-packages/_pytest/mark/structures.py", line 500, in __getattr__
INTERNALERROR>     fail(
INTERNALERROR>   File "/anaconda3/lib/python3.8/site-packages/_pytest/outcomes.py", line 153, in fail
INTERNALERROR>     raise Failed(msg=msg, pytrace=pytrace)
INTERNALERROR> Failed: 'dummy_strawberry_fields_marker' not found in `markers` configuration option
codecov[bot] commented 3 years ago

Codecov Report

Merging #536 (29705e5) into master (98898e8) will decrease coverage by 38.16%. The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #536       +/-   ##
===========================================
- Coverage   98.04%   59.88%   -38.17%     
===========================================
  Files          72       72               
  Lines        7534     7534               
===========================================
- Hits         7387     4512     -2875     
- Misses        147     3022     +2875     
Impacted Files Coverage Δ
strawberryfields/apps/subgraph.py 10.11% <0.00%> (-89.89%) :arrow_down:
strawberryfields/apps/clique.py 10.67% <0.00%> (-89.33%) :arrow_down:
strawberryfields/io.py 8.90% <0.00%> (-87.96%) :arrow_down:
strawberryfields/apps/qchem/dynamics.py 12.82% <0.00%> (-87.18%) :arrow_down:
strawberryfields/plot.py 13.15% <0.00%> (-85.09%) :arrow_down:
strawberryfields/apps/qchem/utils.py 15.78% <0.00%> (-84.22%) :arrow_down:
strawberryfields/apps/similarity.py 16.02% <0.00%> (-83.98%) :arrow_down:
strawberryfields/backends/gaussianbackend/ops.py 17.64% <0.00%> (-82.36%) :arrow_down:
strawberryfields/decompositions.py 18.12% <0.00%> (-81.55%) :arrow_down:
strawberryfields/utils/post_processing.py 18.75% <0.00%> (-81.25%) :arrow_down:
... and 37 more

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 98898e8...29705e5. Read the comment docs.

antalszava commented 2 years ago

Closing this, but it can be re-opened if desired.