NCAS-CMS / NCAS-CMS/cf-python

Validate/run doctests when running the tests

Offen
#4 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@sadielbartholomew arbeitet bereits daran.

Seit 19.3.2021.

Vorherrschende Sprache
Python
Sterne
150
Forks
23
Ø Merge
1 T. 11 Std.
Gemergte PRs (30 T.)
2

Beschreibung

I could run the tests with python run_tests.py, though a few failed. Looking at the doctests, some appear to be invalid or incomplete.

Would be nice to fix these, so they can also be used as tests for the code and API.

Here's an example output of running the current doctests:

$ python -m doctest cf/units.py 
**********************************************************************
File "cf/units.py", line 11, in units.Units
Failed example:
    help(cf.Units())
Exception raised:
    Traceback (most recent call last):
      File "/home/kinow/Development/python/anaconda3/lib/python3.7/doctest.py", line 1329, in __run
        compileflags, 1), test.globs)
      File "<doctest units.Units[0]>", line 1, in <module>
        help(cf.Units())
    NameError: name 'cf' is not defined
**********************************************************************
1 items had failures:
   1 of   1 in units.Units
***Test Failed*** 1 failures.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.