Use the new testing machinery for test_examples (#676)

* WIP: start to use the PyScriptTests machinery to test the examples

* factor test_hello_world out of test_examples

* B011 forbids 'assert False' in tests because python -O remove asserts. Thank you, I knew that.

* improve test_simple_clock and remove it from test_examples

* test_altair

* test_bokeh

* rename

* kill the parametrized test_example and write individual tests for each of them

* test_kmeans it's slow, increase the timeout

* improve these xfail

* kill wait_for_load, no longer needed

* write the name of the issue

* add issue number

* add a trick which I discovered to run test interactively

* move the docstring inside the class
This commit is contained in:
Antonio Cuni
2022-08-12 02:18:42 +02:00
committed by GitHub
parent 513dfe0b42
commit 817d0edc69
4 changed files with 213 additions and 234 deletions

View File

@@ -66,6 +66,15 @@ class PyScriptTest:
# this extra print is useful when using pytest -s, else we start printing
# in the middle of the line
print()
#
# if you use pytest --headed you can see the browser page while
# playwright executes the tests. However, the page is closed very
# quickly as soon as the test finishes. If you want to pause the test
# to have time to inspect it manually, uncomment the next two
# lines. The lines after the 'yield' will be executed during the
# teardown, leaving the page open until you exit pdb.
## yield
## import pdb;pdb.set_trace()
def init_page(self, page):
self.page = page