ecell4_base icon indicating copy to clipboard operation
ecell4_base copied to clipboard

Errors in Python unittests

Open kozo2 opened this issue 7 years ago • 3 comments

env

  • Windows10
  • ecell 4.2.0
  • miniconda Python 3.7.1

Errors

(base) C:\Users\a\ecell4\python\tests>python -m unittest
EEE.......E.EE.
======================================================================
ERROR: test1 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 13, in test1
    self.assertEqual(sp1.count(Species("A")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test2 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 18, in test2
    self.assertEqual(sp1.count(Species("A.B")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test3 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 23, in test3
    self.assertEqual(sp1.count(Species("A(p=u^1).B(b^1)")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test2 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 21, in test2
    self.assertEqual(sp.num_units(), 3)
AttributeError: 'ecell4.core.Species' object has no attribute 'num_units'

======================================================================
ERROR: test4 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 51, in test4
    sp.deserialize('A.B.C')
AttributeError: 'ecell4.core.Species' object has no attribute 'deserialize'

======================================================================
ERROR: test5 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 66, in test5
    self.assertEqual(sp.num_units(), 2)
AttributeError: 'ecell4.core.Species' object has no attribute 'num_units'

----------------------------------------------------------------------
Ran 15 tests in 0.003s

FAILED (errors=6)

kozo2 avatar Oct 28 '18 09:10 kozo2

Species's count, num_units, and deserialize are deprecated. Species::count could be replaced with count_species_matches. To count the number of unit species, check the size of a list given by Species::units. Function Species::deserialize has no alternative. Just use Species constructor instead.

kaizu avatar Oct 29 '18 12:10 kaizu

Close this. If not fixed, please reopen.

kaizu avatar Nov 05 '18 06:11 kaizu

It failed again. Refer to https://api.travis-ci.org/v3/job/455078340/log.txt

kozo2 avatar Nov 19 '18 09:11 kozo2