shaoxiongji / federated-learning

A PyTorch Implementation of Federated Learning http://doi.org/10.5281/zenodo.4321561
http://doi.org/10.5281/zenodo.4321561
MIT License
1.29k stars 372 forks source link

fixture 'net_g' not found #6

Closed csqANDj closed 4 years ago

csqANDj commented 4 years ago

When I run the "main_nn.py", an error appears: `============================= test session starts ============================== platform linux -- Python 3.6.9, pytest-5.3.1, py-1.8.0, pluggy-0.13.1 -- /home/anaconda3/envs/pytorch/bin/python3.6 cachedir: .pytest_cache rootdir: /home/federated-learning-master collecting ... collected 1 item

main_nn.py::test ERROR [100%] test setup failed file /home/federated-learning-master/main_nn.py, line 19 def test(net_g, data_loader): E fixture 'net_g' not found

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

/home/federated-learning-master/main_nn.py:19`

How can I solve it?

shaoxiongji commented 4 years ago

I believe this issue should have solved after several commits. Good luck.