ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 24 forks source link

mkstemp issues in pytest #174

Closed s-mandra closed 4 years ago

s-mandra commented 4 years ago
python3 -m pytest tests/python/simulation_test.py 
Test session starts (platform: linux, Python 3.7.5, pytest 5.2.1, pytest-sugar 0.9.2)
rootdir: /home/dagart/NASA_Local/repository/qflex
plugins: sugar-0.9.2
collecting ... 
 tests/python/simulation_test.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓                                         100% ██████████
===================================================================================== warnings summary ======================================================================================
/home/dagart/.local/lib/python3.7/site-packages/cirq/google/engine/engine.py:32
  /home/dagart/.local/lib/python3.7/site-packages/cirq/google/engine/engine.py:32: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Iterable

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Results (6.37s):
     100 passed
Exception ignored in: <function QFlexCircuit.__del__ at 0x7fe311b9f200>
Traceback (most recent call last):
  File "/home/dagart/NASA_Local/repository/qflex/python/cirq_interface/qflex_circuit.py", line 84, in __del__
TypeError: 'NoneType' object is not callable
Exception ignored in: <function QFlexOrder.__del__ at 0x7fe311b98f80>
Traceback (most recent call last):
  File "/home/dagart/NASA_Local/repository/qflex/python/cirq_interface/qflex_order.py", line 52, in __del__
TypeError: 'NoneType' object is not callable
Exception ignored in: <function QFlexGrid.__del__ at 0x7fe311d19e60>
Traceback (most recent call last):
  File "/home/dagart/NASA_Local/repository/qflex/python/cirq_interface/qflex_grid.py", line 60, in __del__
TypeError: 'NoneType' object is not callable
s-mandra commented 4 years ago

Cirq interfaces handle the closure of temporary files, but pytest has some issues with that.

kkissell commented 4 years ago

This is part of what I believe I fixed in the patch in #289

alexandrupaler commented 4 years ago

closed for the moment, because temp files are handled correctly.