Skip to content

Instantly share code, notes, and snippets.

@bilderbuchi
Last active October 24, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bilderbuchi/2786bffdd807f57433c2663c95812b10 to your computer and use it in GitHub Desktop.
Save bilderbuchi/2786bffdd807f57433c2663c95812b10 to your computer and use it in GitHub Desktop.
Sphinx and pytest problem matchers for Github actions
...
Document: dev/adding_instruments
--------------------------------
**********************************************************************
File "dev/adding_instruments.rst", line 321, in default
Failed example:
extreme.read()
Expected:
'2'
Got:
'1'
**********************************************************************
1 items had failures:
1 of 41 in default
41 tests in 1 items.
40 passed and 1 failed.
***Test Failed*** 1 failures.
Document: api/instruments/agilent/agilent34450A
-----------------------------------------------
**********************************************************************
File "../pymeasure/instruments/agilent/agilent34450A.py", line ?, in default
Failed example:
dmm = Agilent34450A("USB0::...")
Exception raised:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest default[0]>", line 1, in <module>
dmm = Agilent34450A("USB0::...")
NameError: name 'Agilent34450A' is not defined
**********************************************************************
1 items had failures:
1 of 1 in default
1 tests in 1 items.
0 passed and 1 failed.
***Test Failed*** 1 failures.
Doctest summary
===============
42 tests
2 failures in tests
0 failures in setup code
0 failures in cleanup code
build finished with problems.
make: *** [doctest] Error 1
Makefile:165: recipe for target 'doctest' failed
Process completed with exit code 2.
{
"problemMatcher": [
{
"owner": "pylint",
"pattern": [
{
// Matches the 1st line in the output
"regexp": "^(?<path>.+?):(?<line>\d+)$",
"file": 1,
"line": 2
},
{
// Matches the 2nd and 3rd line in the output
"regexp": "^ (?<message>(.|\n)+?)\n$",
// File is carried through from above, so we define the rest of the groups
"message": 1,
"loop": false
}
]
}
]
}
}
{
"problemMatcher": [
{
"owner": "sphinx",
"pattern": [
{
"regexp": "^(?<path>.+?):(?<message>.*? (?<severity>WARNING|ERROR): .+)$",
"file": 1,
"severity": 3,
"message": 2
}
]
},
{
"owner": "sphinx-doctest",
"pattern": [
{
"regexp": "^File \\\"(?<path>.+?)\\\", line (?<line>\\d+|\\?), .*$",
"file": 1,
"line": 2,
"message": 3
},
{
"regexp": "^(?<message>[^*]*)$",
"message": 1,
"loop": true
}
]
}
]
}
...
reading sources... [ 98%] tutorial/graphical
reading sources... [ 99%] tutorial/index
reading sources... [100%] tutorial/procedure
/home/runner/work/pymeasure/pymeasure/pymeasure/adapters/telnet.py:docstring of pymeasure.adapters.TelnetAdapter:9: WARNING: Field list ends without a blank line; unexpected unindent.
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/agilent/agilent34450A.py:docstring of pymeasure.instruments.agilent.Agilent34450A.configure_voltage:5: WARNING: Unexpected indentation.
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/agilent/agilent34450A.py:docstring of pymeasure.instruments.agilent.Agilent34450A.voltage_ac_range:3: WARNING: Unexpected indentation.
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/agilent/agilent34450A.py:docstring of pymeasure.instruments.agilent.Agilent34450A.voltage_ac_range:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/agilent/agilentB1500.py:docstring of pymeasure.instruments.agilent.agilentB1500.CustomIntEnum.get:1: WARNING: duplicate object description of pymeasure.instruments.agilent.agilentB1500.CustomIntEnum.get, other instance in api/instruments/agilent/agilentB1500, use :noindex: for one of them
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/attocube/adapters.py:docstring of pymeasure.instruments.attocube.adapters.AttocubeConsoleAdapter.write:5: WARNING: Field list ends without a blank line; unexpected unindent.
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/attocube/anc300.py:docstring of pymeasure.instruments.attocube.anc300.Axis.move:7: WARNING: Field list ends without a blank line; unexpected unindent.
looking for now-outdated files... none found
pickling environment... done
/home/runner/work/pymeasure/pymeasure/docs/api/instruments/attocube/index.rst: WARNING: document isn't included in any toctree
checking consistency... done
preparing documents... done
writing output... [ 0%] about/authors
writing output... [ 1%] about/license
writing output... [ 2%] api/adapters
writing output... [ 3%] api/display/Qt
...
writing output... [ 98%] tutorial/graphical
writing output... [ 99%] tutorial/index
writing output... [100%] tutorial/procedure
/home/runner/work/pymeasure/pymeasure/pymeasure/instruments/keithley/keithley6517b.py:docstring of pymeasure.instruments.keithley.Keithley6517B.trigger:1: WARNING: more than one target found for cross-reference 'trigger_on_bus': pymeasure.instruments.keithley.Keithley2400.trigger_on_bus, pymeasure.instruments.keithley.Keithley6221.trigger_on_bus
generating indices... genindex py-modindexdone
writing additional pages... searchdone
copying images... [ 14%] images/PyMeasure.png
copying images... [ 28%] tutorial/pymeasure-managedwindow-running.png
copying images... [ 42%] tutorial/pymeasure-plotter.png
copying images... [ 57%] tutorial/pymeasure-managedwindow.png
copying images... [ 71%] tutorial/pymeasure-managedwindow-queued.png
copying images... [ 85%] tutorial/pymeasure-managedwindow-resume.png
copying images... [100%] tutorial/pymeasure-sequencer.png
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 9 warnings.
The HTML pages are in _build/html.
Build finished. The HTML pages are in _build/html.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment