question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.11.4: pytest is failing when `pytest-randomly` plugin is used

See original GitHub issue

I’m trying to package your module as rpm packag. So I’m using typical in such case build, install and test cycle used on building package from non-root account:

  • “setup.py build”
  • “setup.py install --root </install/prefix>”
  • "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

May I ask for help because few units are failing:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.11.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.11.4-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=3239909864
rootdir: /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0
collected 2585 items

tests/test_knitr_spin.py .                                                                                                                                           [  0%]
tests/test_read_simple_matlab.py ..                                                                                                                                  [  0%]
tests/test_read_simple_rmd.py .........                                                                                                                              [  0%]
tests/test_rmd_to_ipynb.py ......                                                                                                                                    [  0%]
tests/test_changelog.py ...                                                                                                                                          [  0%]
tests/test_pre_commit_scripts.py ....s...                                                                                                                            [  1%]
tests/test_read_dotnet_try_markdown.py ...                                                                                                                           [  1%]
tests/test_read_simple_R.py ............                                                                                                                             [  1%]
tests/test_read_simple_sphinx.py ...                                                                                                                                 [  1%]
tests/test_read_write_functions.py .....                                                                                                                             [  2%]
tests/test_ipynb_to_myst.py .s........s.                                                                                                                             [  2%]
tests/test_save_multiple.py .....................................................                                                                                    [  4%]
tests/test_metadata_filter.py .................                                                                                                                      [  5%]
tests/test_read_simple_ipynb.py .                                                                                                                                    [  5%]
tests/test_ipynb_to_py.py ....................                                                                                                                       [  6%]
tests/test_read_simple_markdown.py ....................................                                                                                              [  7%]
tests/test_read_simple_java.py .                                                                                                                                     [  7%]
tests/test_config.py .................                                                                                                                               [  8%]
tests/test_preserve_empty_cells.py .......                                                                                                                           [  8%]
tests/test_doxygen.py ..........                                                                                                                                     [  8%]
tests/test_pre_commit_4_sync_execute.py s                                                                                                                            [  8%]
tests/test_isort.py .                                                                                                                                                [  8%]
tests/test_markdown_in_code_cells.py ....                                                                                                                            [  8%]
tests/test_read_simple_groovy.py .                                                                                                                                   [  9%]
tests/test_cell_id.py .                                                                                                                                              [  9%]
tests/test_formats.py ................s........                                                                                                                      [ 10%]
tests/test_unicode.py ...............................                                                                                                                [ 11%]
tests/test_write_does_not_modify_notebook.py ..............................................................................................................          [ 15%]
tests/test_cells.py ...............                                                                                                                                  [ 16%]
tests/test_read_simple_clojure.py .                                                                                                                                  [ 16%]
tests/test_header.py ..........                                                                                                                                      [ 16%]
tests/test_nbformat_version.py .......                                                                                                                               [ 16%]
tests/test_jupytext_errors.py ..                                                                                                                                     [ 16%]
tests/test_pre_commit_0_ipynb_to_py.py s                                                                                                                             [ 16%]
tests/test_mirror.py ........s.......s.........ss...s.....................s..........s.....................................s............s.........s........s........ [ 22%]
................s................ss......s.......s............s.........s.............s.......s.............................................s....................... [ 28%]
.............s..s......s..s......s...............s....s...............................s..............s..                                                             [ 32%]
tests/test_execute.py ....s...                                                                                                                                       [ 33%]
tests/test_read_simple_percent.py ......................                                                                                                             [ 33%]
tests/test_jupytext_read.py ..                                                                                                                                       [ 34%]
tests/test_read_folding_markers.py .....                                                                                                                             [ 34%]
tests/test_read_simple_nomarker.py ..                                                                                                                                [ 34%]
tests/test_pre_commit_mode.py ............                                                                                                                           [ 34%]
tests/test_pre_commit_5_reformat_markdown.py s                                                                                                                       [ 34%]
tests/test_read_simple_julia.py .                                                                                                                                    [ 34%]
tests/test_using_cli.py .                                                                                                                                            [ 34%]
tests/test_cell_metadata.py ..........................F.............FF.F....F..F..F..F..                                                                             [ 37%]
tests/test_pep8.py ...................................................................................................................                               [ 41%]
tests/test_ipynb_to_R.py ....                                                                                                                                        [ 41%]
tests/test_read_simple_rust.py ...                                                                                                                                   [ 41%]
tests/test_read_simple_csharp.py .......                                                                                                                             [ 42%]
tests/test_read_all_py.py ..........................................................................................................                                 [ 46%]
tests/test_load_multiple.py ..                                                                                                                                       [ 46%]
tests/test_paired_paths.py ......................                                                                                                                    [ 47%]
tests/test_hide_remove_input_outputs_rmarkdown.py ........                                                                                                           [ 47%]
tests/test_read_simple_pandoc.py sssss                                                                                                                               [ 47%]
tests/test_active_cells.py .....................                                                                                                                     [ 48%]
. .                                                                                                                                                                  [ 48%]
tests/test_active_cells.py .......                                                                                                                                   [ 48%]
tests/test_auto_ext.py .....................................x........................s........................                                                       [ 52%]
tests/test_escape_magics.py ................................................................................                                                         [ 55%]
tests/test_stringparser.py ....                                                                                                                                      [ 55%]
tests/test_read_simple_scheme.py .                                                                                                                                   [ 55%]
tests/test_pytest.py ..                                                                                                                                              [ 55%]
tests/test_ipynb_to_rmd.py ........................                                                                                                                  [ 56%]
tests/test_custom_cell_magics.py .                                                                                                                                   [ 56%]
tests/test_cli_config.py ...........                                                                                                                                 [ 56%]
tests/test_black.py ....s........                                                                                                                                    [ 57%]
tests/test_jupytext_nbconvert_round_trip.py .......................                                                                                                  [ 58%]
tests/test_metadata_filters_from_config.py .                                                                                                                         [ 58%]
tests/test_compare.py .....................                                                                                                                          [ 59%]
tests/test_read_incomplete_rmd.py ...                                                                                                                                [ 59%]
tests/test_cm_config.py ............                                                                                                                                 [ 59%]
tests/test_contentsmanager.py .s..s.............................................................s......s......s..................................................... [ 65%]
.....................................s....................................s............s...................s.......s..s...s.....................................s... [ 71%]
..........................................................s....ss...s.......................s................................................s.............s........ [ 77%]
....                                                                                                                                                                 [ 77%]
tests/test_pre_commit_2_sync_nbstripout.py s                                                                                                                         [ 77%]
tests/test_pre_commit_3_sync_black_nbstripout.py s                                                                                                                   [ 77%]
tests/test_trust_notebook.py ................................................                                                                                        [ 79%]
tests/test_read_simple_hydrogen.py .......                                                                                                                           [ 80%]
tests/test_combine.py ..................................................                                                                                             [ 81%]
tests/test_cli.py ...............s.s.....................s......................................s..........s......................s.......s............s............ [ 87%]
...ss........s................s...................................s.s.........s....s.......s.s........................s.....................s...................s... [ 93%]
........s.........s.................s.......s....................................................s........                                                           [ 98%]
tests/test_read_simple_python.py ................................................                                                                                    [ 99%]
tests/test_pre_commit_1_sync.py s                                                                                                                                    [100%]

================================================================================= FAILURES =================================================================================
____________________________________________________ test_parse_rmd_options[r plot_1, echo=TRUE-language_and_metadata4] ____________________________________________________

options = 'r plot_1, echo=TRUE', language_and_metadata = ('R', {'echo': True})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'echo': True, 'name': 'plot_1'}), expected = ('R', {'echo': True}), actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1,6 +1,7 @@
E            [
E             "R",
E             {
E           -  "echo": true
E           +  "echo": true,
E           +  "name": "plot_1"
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
_________________________________________ test_parse_rmd_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] _________________________________________

options = 'r chunk_name, include=FALSE, active="Rmd"', language_and_metadata = ('R', {'active': 'Rmd'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'active': 'Rmd', 'name': 'chunk_name', 'tags': ['remove_cell']}), expected = ('R', {'active': 'Rmd'}), actual_name = 'actual', expected_name = 'expected'
return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1,6 +1,10 @@
E            [
E             "R",
E             {
E           -  "active": "Rmd"
E           +  "active": "Rmd",
E           +  "name": "chunk_name",
E           +  "tags": [
E           +   "remove_cell"
E           +  ]
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
_________________________________________________________ test_build_options[r echo=FALSE-language_and_metadata3] __________________________________________________________

options = 'r echo=FALSE', language_and_metadata = ('R', {})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r', expected = 'r echo=FALSE', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -r echo=FALSE
E           +r

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
______________________________________________ test_build_options[python include=FALSE, active="Rmd"-language_and_metadata8] _______________________________________________

options = 'python include=FALSE, active="Rmd"', language_and_metadata = ('python', {'active': 'Rmd'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'python active="Rmd"', expected = 'python include=FALSE, active="Rmd"', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -python include=FALSE, active="Rmd"
E           +python active="Rmd"

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
_________________________________ test_build_options[python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}-language_and_metadata6] __________________________________

options = 'python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}', language_and_metadata = ('python', {'echo': '#R_CODE#{sum(a+c(1,2))>1}', 'tags': ['a', 'b', 'c']})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'python tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}', expected = 'python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}', actual_name = 'actual'
expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}
E           +python tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
______________________________________________________ test_build_options[r plot_1, echo=TRUE-language_and_metadata4] ______________________________________________________

options = 'r plot_1, echo=TRUE', language_and_metadata = ('R', {'echo': True})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r echo=TRUE', expected = 'r plot_1, echo=TRUE', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -r plot_1, echo=TRUE
E           +r echo=TRUE

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
__________________________________________ test_parse_rmd_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1] ___________________________________________

options = 'r plot_1, dpi=72, fig.path="fig_path/"', language_and_metadata = ('R', {'dpi': 72, 'fig.path': 'fig_path/'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'dpi': 72, 'fig.path': 'fig_path/', 'name': 'plot_1'}), expected = ('R', {'dpi': 72, 'fig.path': 'fig_path/'}), actual_name = 'actual'
expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -2,6 +2,7 @@
E             "R",
E             {
E              "dpi": 72,
E           -  "fig.path": "fig_path/"
E           +  "fig.path": "fig_path/",
E           +  "name": "plot_1"
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
_______________________________________________________ test_parse_rmd_options[r echo=FALSE-language_and_metadata3] ________________________________________________________

options = 'r echo=FALSE', language_and_metadata = ('R', {})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'tags': ['remove_input']}), expected = ('R', {}), actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1,4 +1,8 @@
E            [
E             "R",
E           - {}
E           + {
E           +  "tags": [
E           +   "remove_input"
E           +  ]
E           + }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/compare.py:47: AssertionError
============================================================================= warnings summary =============================================================================
jupytext/cell_reader.py:20
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/cell_reader.py:20: UserWarning: Sphinx Gallery in version 0.9.0 is not supported by Jupytext. Please use sphinx-gallery<=0.7.0 instead. If that is an issue, feel free to report it at https://github.com/mwouts/jupytext/issues, or even better, prepare a PR to handle the new signature of sphinx_gallery.notebook.rst2md.
    warnings.warn(

tests/test_pre_commit_scripts.py::test_manual_call_of_pre_commit_hook
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/jupytext/cli.py:332: DeprecationWarning: The --pre-commit argument is deprecated. Please consider switching to the pre-commit.com framework (let us know at https://github.com/mwouts/jupytext/issues if that is an issue for you)
    warnings.warn(

tests/test_execute.py::test_execute_sync
  /usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:110: DeprecationWarning: 'contextfilter' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.
    def markdown2html(self, context, source):

tests/test_cm_config.py::test_incorrect_config_message[jupytext.toml-not_a_jupytext_option = true]
tests/test_cm_config.py::test_incorrect_config_message[jupytext.toml-not_a_jupytext_option = true]
tests/test_cm_config.py::test_incorrect_config_message[.jupytext.py-c.not_a_jupytext_option = True]
tests/test_cm_config.py::test_incorrect_config_message[.jupytext.py-c.not_a_jupytext_option = True]
  /usr/lib/python3.8/site-packages/traitlets/config/configurable.py:82: DeprecationWarning: Passing unrecognized arguments to super(JupytextConfiguration).__init__(not_a_jupytext_option=True).
  object.__init__() takes exactly one argument (the instance to initialize)
  This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.
    super(Configurable, self).__init__(**kwargs)

tests/test_contentsmanager.py: 48 warnings
  /usr/lib/python3.8/site-packages/send2trash/plat_gio.py:18: PyGIDeprecationWarning: GObject.GError is deprecated; use GLib.GError instead
    except GObject.GError as e:

tests/test_cli.py::test_cli_expect_errors
  [warning] The --pre-commit argument is deprecated. Please consider switching to the pre-commit.com framework (let us know at https://github.com/mwouts/jupytext/issues if that is an issue for you)

tests/test_cli.py::test_format_prefix_suffix
  [warning] You have passed a file name to the '--to' option, when a format description was expected. Maybe you want to use the '-o' option instead?

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_pre_commit_scripts.py:335: pandoc>=2.11 is not available
SKIPPED [1] tests/test_ipynb_to_myst.py:171: myst is available
SKIPPED [1] tests/test_ipynb_to_myst.py:162: myst is available
SKIPPED [1] tests/test_pre_commit_4_sync_execute.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_formats.py:324: pandoc>=2.11 is not available
SKIPPED [1] tests/test_pre_commit_0_ipynb_to_py.py:16: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_mirror.py:208: sphinx_gallery is not available
SKIPPED [11] tests/test_mirror.py:151: sphinx_gallery is not available
SKIPPED [17] tests/test_mirror.py:131: pandoc>=2.11 is not available
SKIPPED [1] tests/test_mirror.py:202: sphinx_gallery is not available
SKIPPED [1] tests/test_execute.py:150: irkernel is not installed
SKIPPED [1] tests/test_pre_commit_5_reformat_markdown.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_read_simple_pandoc.py:35: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:13: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:82: Pandoc is installed
SKIPPED [1] tests/test_read_simple_pandoc.py:64: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:50: pandoc>=2.11 is not available
SKIPPED [1] tests/test_auto_ext.py:36: No file_extension in language_info
SKIPPED [1] tests/test_black.py:68: autopep8 not found
SKIPPED [17] tests/test_contentsmanager.py:180: pandoc>=2.11 is not available
SKIPPED [1] tests/test_contentsmanager.py:1188: sphinx_gallery is not available
SKIPPED [2] tests/test_contentsmanager.py:1765: jupyterfs is not available
SKIPPED [1] tests/test_pre_commit_2_sync_nbstripout.py:14: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_pre_commit_3_sync_black_nbstripout.py:13: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_cli.py:1075: pandoc>=2.11 is not available
SKIPPED [15] tests/test_cli.py:557: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:795: sphinx_gallery is not available
SKIPPED [3] tests/test_cli.py:991: pandoc>=2.11 is not available
SKIPPED [5] tests/test_cli.py:1005: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:1188: Please run 'python -m ipykernel install --name python_kernel --user'
SKIPPED [1] tests/test_pre_commit_1_sync.py:17: Jupytext folder is not a git repository #814
XFAIL tests/test_auto_ext.py::test_auto_from_kernelspecs_works[/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.4/tests/notebooks/ipynb_sage/sage_print_hello.ipynb]
  reason: Sage notebooks have Python in their language_info metadata, see #727
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, echo=TRUE-language_and_metadata4] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r echo=FALSE-language_and_metadata3] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[python include=FALSE, active="Rmd"-language_and_metadata8] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}-language_and_metadata6] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r plot_1, echo=TRUE-language_and_metadata4] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r echo=FALSE-language_and_metadata3] - AssertionError:
============================================== 8 failed, 2480 passed, 94 skipped, 1 xfailed, 57 warnings in 160.49s (0:02:40) ==============================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
[warning] (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-cacdfa54-1a74-4a90-aec3-6475cd47892c'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Dec 10, 2021

You’re welcome! Thank you for introducing me to pytest-randomly, that’s an interesting tool (in the end I had to change how the sets of parameters are generated, although I am not sure I understand why pytest-randomly was mixing my parameters 😄 )

BTW I also plan to reduce the number of warnings soon with #893

1reaction
kloczekcommented, Dec 4, 2021

Just tested 1.13.3 and still with pytest-randomly sometimes pytaest is failing. Looks like to solve that issue https://github.com/mrbean-bremen/pytest-find-dependencies/ can be used

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.13.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.13.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=2734066668
rootdir: /home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.6.1, cov-2.12.1, anyio-3.3.4, forked-1.3.0, xdist-2.3.0, flaky-3.7.0, tornasync-0.6.0.post2, console-scripts-1.2.0, trio-0.7.0, timeout-2.0.1, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, pyfakefs-4.5.3, hypothesis-6.29.3, benchmark-3.4.1, profiling-1.7.0, datadir-1.3.1, regressions-2.2.0, randomly-3.8.0
collected 2678 items

tests/test_read_simple_clojure.py .                                                                                                                                  [  0%]
tests/test_knitr_spin.py .                                                                                                                                           [  0%]
tests/test_ipynb_to_rmd.py ........................                                                                                                                  [  0%]
tests/test_black.py ......s......                                                                                                                                    [  1%]
tests/test_read_simple_python.py ................................................                                                                                    [  3%]
tests/test_ipynb_to_myst.py .s...s......                                                                                                                             [  3%]
tests/test_ipynb_to_R.py ....                                                                                                                                        [  3%]
tests/test_read_write_functions.py .....                                                                                                                             [  4%]
tests/test_read_incomplete_rmd.py ...                                                                                                                                [  4%]
tests/test_read_simple_quarto.py s                                                                                                                                   [  4%]
tests/test_read_simple_matlab.py ..                                                                                                                                  [  4%]
tests/test_read_simple_groovy.py .                                                                                                                                   [  4%]
tests/test_cli_config.py ...........                                                                                                                                 [  4%]
tests/test_config.py ..................                                                                                                                              [  5%]
tests/test_pre_commit_3_sync_black_nbstripout.py s                                                                                                                   [  5%]
tests/test_cells.py ................                                                                                                                                 [  6%]
tests/test_rmd_to_ipynb.py ......                                                                                                                                    [  6%]
tests/test_pre_commit_scripts.py .......s                                                                                                                            [  6%]
tests/test_isort.py s                                                                                                                                                [  6%]
tests/test_using_cli.py .                                                                                                                                            [  6%]
tests/test_pre_commit_4_sync_execute.py s                                                                                                                            [  6%]
tests/test_cell_metadata.py .....................................F..F..FFFF......F......                                                                             [  8%]
tests/test_read_simple_rust.py ...                                                                                                                                   [  8%]
tests/test_read_simple_percent.py ......................                                                                                                             [  9%]
tests/test_execute.py ......s.                                                                                                                                       [ 10%]
tests/test_load_multiple.py ..                                                                                                                                       [ 10%]
tests/test_hide_remove_input_outputs_rmarkdown.py ........                                                                                                           [ 10%]
tests/test_pre_commit_5_reformat_markdown.py s                                                                                                                       [ 10%]
tests/test_combine.py ...................................................                                                                                            [ 12%]
tests/test_trust_notebook.py .................................................                                                                                       [ 14%]
tests/test_stringparser.py ....                                                                                                                                      [ 14%]
tests/test_cell_markers.py ..                                                                                                                                        [ 14%]
tests/test_read_simple_julia.py .                                                                                                                                    [ 14%]
tests/test_compare.py .....................                                                                                                                          [ 15%]
tests/test_read_simple_scheme.py .                                                                                                                                   [ 15%]
tests/test_metadata_filter.py .................                                                                                                                      [ 15%]
tests/test_cm_config.py .............                                                                                                                                [ 16%]
tests/test_read_simple_java.py .                                                                                                                                     [ 16%]
tests/test_read_simple_R.py ............                                                                                                                             [ 16%]
tests/test_markdown_in_code_cells.py ....                                                                                                                            [ 17%]
tests/test_metadata_filters_from_config.py .                                                                                                                         [ 17%]
tests/test_cell_id.py .                                                                                                                                              [ 17%]
tests/test_read_simple_markdown.py ....................................                                                                                              [ 18%]
tests/test_read_simple_rmd.py ..........                                                                                                                             [ 18%]
tests/test_read_folding_markers.py .....                                                                                                                             [ 19%]
tests/test_read_simple_ocaml.py ..                                                                                                                                   [ 19%]
tests/test_read_simple_pandoc.py .ssss                                                                                                                               [ 19%]
tests/test_active_cells.py ............................                                                                                                              [ 20%]
tests/test_cli.py ......s.s......s.............s.s.........s..s.............ss...................................................................................... [ 25%]
.s...................sss............s.................s...............................s..........s............................s................s.................... [ 31%]
..............................s.........s........s.s.....s...............s...................s..............                                                         [ 35%]
tests/test_read_all_py.py ................................................................................................................                           [ 40%]
tests/test_jupytext_errors.py ..                                                                                                                                     [ 40%]
tests/test_doxygen.py ..........                                                                                                                                     [ 40%]
tests/test_write_does_not_modify_notebook.py ..............................................................................................................          [ 44%]
tests/test_preserve_empty_cells.py .......                                                                                                                           [ 44%]
tests/test_auto_ext.py ...........................x......................s.....................................                                                      [ 48%]
tests/test_jupytext_read.py ..                                                                                                                                       [ 48%]
tests/test_read_simple_csharp.py .......                                                                                                                             [ 48%]
tests/test_header.py ..........                                                                                                                                      [ 48%]
tests/test_pre_commit_mode.py ............                                                                                                                           [ 49%]
tests/test_paired_paths.py ......................                                                                                                                    [ 50%]
tests/test_pep8.py .........................................................................................................................                         [ 54%]
tests/test_jupytext_nbconvert_round_trip.py .......................                                                                                                  [ 55%]
tests/test_save_multiple.py .....................................................                                                                                    [ 57%]
tests/test_read_empty_text_notebook.py s..................................                                                                                           [ 58%]
tests/test_ipynb_to_py.py ....................                                                                                                                       [ 59%]
tests/test_pre_commit_2_sync_nbstripout.py s                                                                                                                         [ 59%]
tests/test_read_simple_hydrogen.py .......                                                                                                                           [ 59%]
tests/test_pre_commit_0_ipynb_to_py.py s                                                                                                                             [ 60%]
tests/test_read_simple_nomarker.py ..                                                                                                                                [ 60%]
tests/test_read_simple_ipynb.py .                                                                                                                                    [ 60%]
tests/test_pytest.py ..                                                                                                                                              [ 60%]
tests/test_escape_magics.py ................................................................................                                                         [ 63%]
tests/test_pre_commit_1_sync.py s                                                                                                                                    [ 63%]
tests/test_nbformat_version.py .......                                                                                                                               [ 63%]
tests/test_read_dotnet_try_markdown.py ...                                                                                                                           [ 63%]
tests/test_formats.py ..............s.............                                                                                                                   [ 64%]
tests/test_mirror.py ........s......s...................................s........s....................s......s.s..........s...s...s..s....................s..s...... [ 69%]
...s...................s........................s......s...........s...................s.......s...s....ss..............s..........s......s...........s........s.... [ 76%]
.............s...........................................................s.s.......s........s...s..s........s..s......                                               [ 80%]
tests/test_raw_strings.py .........                                                                                                                                  [ 80%]
tests/test_read_simple_sphinx.py ...                                                                                                                                 [ 80%]
tests/test_changelog.py ...                                                                                                                                          [ 81%]
tests/test_custom_cell_magics.py .                                                                                                                                   [ 81%]
tests/test_unicode.py ...............................                                                                                                                [ 82%]
tests/test_contentsmanager.py ...s.........................s.......s.............................s........................s..................s...................... [ 87%]
.........s......................s...s......s.....................s.................................s.........s.......................................s.s.........s.. [ 93%]
.........................s.s.........................s.............................s.................s...s..........s.......s.........s.........s.................s. [ 99%]
.............                                                                                                                                                        [100%]

================================================================================= FAILURES =================================================================================
____________________________________________ test_parse_rmd_options[python include=FALSE, active="Rmd"-language_and_metadata8] _____________________________________________

options = 'python include=FALSE, active="Rmd"', language_and_metadata = ('python', {'active': 'Rmd'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('python', {'active': 'Rmd', 'tags': ['remove_cell']}), expected = ('python', {'active': 'Rmd'}), actual_name = 'actual', expected_name = 'expected'
return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1,6 +1,9 @@
E            [
E             "python",
E             {
E           -  "active": "Rmd"
E           +  "active": "Rmd",
E           +  "tags": [
E           +   "remove_cell"
E           +  ]
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
___________________________________________ test_build_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] ___________________________________________

options = 'r chunk_name, include=FALSE, active="Rmd"', language_and_metadata = ('R', {'active': 'Rmd'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r active="Rmd"', expected = 'r chunk_name, include=FALSE, active="Rmd"', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -r chunk_name, include=FALSE, active="Rmd"
E           +r active="Rmd"

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
__________________________________________ test_parse_rmd_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1] ___________________________________________

options = 'r plot_1, dpi=72, fig.path="fig_path/"', language_and_metadata = ('R', {'dpi': 72, 'fig.path': 'fig_path/'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'dpi': 72, 'fig.path': 'fig_path/', 'name': 'plot_1'}), expected = ('R', {'dpi': 72, 'fig.path': 'fig_path/'}), actual_name = 'actual'
expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -2,6 +2,7 @@
E             "R",
E             {
E              "dpi": 72,
E           -  "fig.path": "fig_path/"
E           +  "fig.path": "fig_path/",
E           +  "name": "plot_1"
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
_________________________________________ test_parse_rmd_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] _________________________________________

options = 'r chunk_name, include=FALSE, active="Rmd"', language_and_metadata = ('R', {'active': 'Rmd'})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'active': 'Rmd', 'name': 'chunk_name', 'tags': ['remove_cell']}), expected = ('R', {'active': 'Rmd'}), actual_name = 'actual', expected_name = 'expected'
return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1,6 +1,10 @@
E            [
E             "R",
E             {
E           -  "active": "Rmd"
E           +  "active": "Rmd",
E           +  "name": "chunk_name",
E           +  "tags": [
E           +   "remove_cell"
E           +  ]
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
_______________________________ test_parse_rmd_options[python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}-language_and_metadata6] ________________________________

options = 'python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}', language_and_metadata = ('python', {'echo': '#R_CODE#{sum(a+c(1,2))>1}', 'tags': ['a', 'b', 'c']})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_parse_rmd_options(options, language_and_metadata):
>       compare(rmd_options_to_metadata(options), language_and_metadata)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('python', {'echo': '#R_CODE#{sum(a+c(1,2))>1}', 'name': 'noname', 'tags': ['a', 'b', 'c']})
expected = ('python', {'echo': '#R_CODE#{sum(a+c(1,2))>1}', 'tags': ['a', 'b', 'c']}), actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -2,6 +2,7 @@
E             "python",
E             {
E              "echo": "#R_CODE#{sum(a+c(1,2))>1}",
E           +  "name": "noname",
E              "tags": [
E               "a",
E               "b",

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
_________________________________________________________ test_build_options[r echo=FALSE-language_and_metadata3] __________________________________________________________

options = 'r echo=FALSE', language_and_metadata = ('R', {})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r', expected = 'r echo=FALSE', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -r echo=FALSE
E           +r

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
______________________________________________________ test_build_options[r plot_1, echo=TRUE-language_and_metadata4] ______________________________________________________

options = 'r plot_1, echo=TRUE', language_and_metadata = ('R', {'echo': True})

    @pytest.mark.parametrize("options,language_and_metadata", SAMPLES)
    def test_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r echo=TRUE', expected = 'r plot_1, echo=TRUE', actual_name = 'actual', expected_name = 'expected', return_diff = False

    def compare(
        actual, expected, actual_name="actual", expected_name="expected", return_diff=False
    ):
        """Compare two strings, lists or dict-like objects"""
        if actual != expected:
            diff = difflib.unified_diff(
                _multilines(expected),
                _multilines(actual),
                expected_name,
                actual_name,
                lineterm="",
            )
            if expected_name == "" and actual_name == "":
                diff = list(diff)[2:]
            diff = "\n".join(diff)
            if return_diff:
                return diff
>           raise AssertionError("\n" + diff)
E           AssertionError:
E           --- expected
E           +++ actual
E           @@ -1 +1 @@
E           -r plot_1, echo=TRUE
E           +r echo=TRUE

/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/compare.py:47: AssertionError
============================================================================= warnings summary =============================================================================
jupytext/cell_reader.py:20
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/cell_reader.py:20: UserWarning: Sphinx Gallery in version 0.10.1 is not supported by Jupytext. Please use sphinx-gallery<=0.7.0 instead. If that is an issue, feel free to report it at https://github.com/mwouts/jupytext/issues, or even better, prepare a PR to handle the new signature of sphinx_gallery.notebook.rst2md.
    warnings.warn(

../../../../../usr/lib/python3.8/site-packages/jsonschema/validators.py:190: 67 warnings
tests/test_read_simple_clojure.py: 6 warnings
tests/test_knitr_spin.py: 23 warnings
tests/test_ipynb_to_rmd.py: 167 warnings
tests/test_black.py: 46 warnings
tests/test_read_simple_python.py: 194 warnings
tests/test_ipynb_to_myst.py: 20 warnings
tests/test_ipynb_to_R.py: 24 warnings
tests/test_read_write_functions.py: 10 warnings
tests/test_read_incomplete_rmd.py: 10 warnings
tests/test_read_simple_matlab.py: 2 warnings
tests/test_read_simple_groovy.py: 6 warnings
tests/test_cli_config.py: 20 warnings
tests/test_cells.py: 12 warnings
tests/test_rmd_to_ipynb.py: 58 warnings
tests/test_pre_commit_scripts.py: 7 warnings
tests/test_using_cli.py: 44 warnings
tests/test_read_simple_rust.py: 19 warnings
tests/test_read_simple_percent.py: 63 warnings
tests/test_execute.py: 34 warnings
tests/test_load_multiple.py: 2 warnings
tests/test_hide_remove_input_outputs_rmarkdown.py: 16 warnings
tests/test_combine.py: 41 warnings
tests/test_trust_notebook.py: 697 warnings
tests/test_cell_markers.py: 2 warnings
tests/test_read_simple_julia.py: 5 warnings
tests/test_compare.py: 64 warnings
tests/test_read_simple_scheme.py: 12 warnings
tests/test_metadata_filter.py: 9 warnings
tests/test_cm_config.py: 8 warnings
tests/test_read_simple_java.py: 6 warnings
tests/test_read_simple_R.py: 50 warnings
tests/test_markdown_in_code_cells.py: 7 warnings
tests/test_metadata_filters_from_config.py: 3 warnings
tests/test_cell_id.py: 2 warnings
tests/test_read_simple_markdown.py: 103 warnings
tests/test_read_simple_rmd.py: 37 warnings
tests/test_read_folding_markers.py: 16 warnings
tests/test_read_simple_ocaml.py: 2 warnings
tests/test_active_cells.py: 32 warnings
tests/test_cli.py: 206 warnings
  /usr/lib/python3.8/site-packages/jsonschema/validators.py:190: DeprecationWarning: Passing a schema to Validator.iter_errors is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).iter_errors(...) instead.
    warnings.warn(

tests/test_pre_commit_scripts.py::test_manual_call_of_pre_commit_hook
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/jupytext/cli.py:341: DeprecationWarning: The --pre-commit argument is deprecated. Please consider switching to the pre-commit.com framework (let us know at https://github.com/mwouts/jupytext/issues if that is an issue for you)
    warnings.warn(

tests/test_using_cli.py::test_jupytext_commands_in_the_documentation_work
  /usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:110: DeprecationWarning: 'contextfilter' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.
    def markdown2html(self, context, source):

tests/test_cm_config.py::test_incorrect_config_message[.jupytext.py-c.not_a_jupytext_option = True]
tests/test_cm_config.py::test_incorrect_config_message[.jupytext.py-c.not_a_jupytext_option = True]
tests/test_cm_config.py::test_incorrect_config_message[pyproject.toml-[tool.jupytext]\nnot_a_jupytext_option = true]
tests/test_cm_config.py::test_incorrect_config_message[pyproject.toml-[tool.jupytext]\nnot_a_jupytext_option = true]
tests/test_cm_config.py::test_incorrect_config_message[jupytext.toml-not_a_jupytext_option = true]
tests/test_cm_config.py::test_incorrect_config_message[jupytext.toml-not_a_jupytext_option = true]
  /usr/lib/python3.8/site-packages/traitlets/config/configurable.py:85: DeprecationWarning: Passing unrecognized arguments to super(JupytextConfiguration).__init__(not_a_jupytext_option=True).
  object.__init__() takes exactly one argument (the instance to initialize)
  This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.
    super(Configurable, self).__init__(**kwargs)

tests/test_cli.py::test_format_prefix_suffix
  [warning] You have passed a file name to the '--to' option, when a format description was expected. Maybe you want to use the '-o' option instead?

tests/test_cli.py: 2821 warnings
tests/test_read_all_py.py: 2504 warnings
tests/test_doxygen.py: 3 warnings
tests/test_write_does_not_modify_notebook.py: 200 warnings
tests/test_preserve_empty_cells.py: 47 warnings
tests/test_auto_ext.py: 195 warnings
tests/test_jupytext_read.py: 2 warnings
tests/test_read_simple_csharp.py: 8 warnings
tests/test_header.py: 7 warnings
tests/test_pre_commit_mode.py: 27 warnings
tests/test_paired_paths.py: 3 warnings
tests/test_pep8.py: 1273 warnings
tests/test_jupytext_nbconvert_round_trip.py: 53 warnings
tests/test_save_multiple.py: 512 warnings
tests/test_ipynb_to_py.py: 119 warnings
tests/test_read_simple_hydrogen.py: 21 warnings
tests/test_read_simple_nomarker.py: 14 warnings
tests/test_pytest.py: 5 warnings
tests/test_escape_magics.py: 67 warnings
tests/test_nbformat_version.py: 5 warnings
tests/test_read_dotnet_try_markdown.py: 3 warnings
tests/test_formats.py: 4 warnings
tests/test_mirror.py: 4393 warnings
tests/test_raw_strings.py: 8 warnings
tests/test_read_simple_sphinx.py: 19 warnings
tests/test_custom_cell_magics.py: 3 warnings
tests/test_unicode.py: 46 warnings
tests/test_contentsmanager.py: 3594 warnings
  [warning] Passing a schema to Validator.iter_errors is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).iter_errors(...) instead.

tests/test_cli.py::test_cli_expect_errors
  [warning] The --pre-commit argument is deprecated. Please consider switching to the pre-commit.com framework (let us know at https://github.com/mwouts/jupytext/issues if that is an issue for you)

tests/test_contentsmanager.py: 48 warnings
  [warning] GObject.GError is deprecated; use GLib.GError instead

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_black.py:68: autopep8 not found
SKIPPED [1] tests/test_ipynb_to_myst.py:162: myst is available
SKIPPED [1] tests/test_ipynb_to_myst.py:171: myst is available
SKIPPED [1] tests/test_read_simple_quarto.py:9: quarto>=0.2 is not available
SKIPPED [1] tests/test_pre_commit_3_sync_black_nbstripout.py:13: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_pre_commit_scripts.py:335: pandoc>=2.11 is not available
SKIPPED [1] tests/test_isort.py:8: isort not found
SKIPPED [1] tests/test_pre_commit_4_sync_execute.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_execute.py:150: irkernel is not installed
SKIPPED [1] tests/test_pre_commit_5_reformat_markdown.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_read_simple_pandoc.py:35: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:50: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:13: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:64: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:796: sphinx_gallery is not available
SKIPPED [5] tests/test_cli.py:1010: pandoc>=2.11 is not available
SKIPPED [15] tests/test_cli.py:558: pandoc>=2.11 is not available
SKIPPED [3] tests/test_cli.py:996: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:1080: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:1220: Please run 'python -m ipykernel install --name python_kernel --user'
SKIPPED [1] tests/test_auto_ext.py:36: No file_extension in language_info
SKIPPED [1] tests/test_read_empty_text_notebook.py:14: quarto is not available
SKIPPED [1] tests/test_pre_commit_2_sync_nbstripout.py:14: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_pre_commit_0_ipynb_to_py.py:16: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_pre_commit_1_sync.py:17: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_formats.py:350: pandoc>=2.11 is not available
SKIPPED [17] tests/test_mirror.py:132: pandoc>=2.11 is not available
SKIPPED [1] tests/test_mirror.py:225: sphinx_gallery is not available
SKIPPED [7] tests/test_mirror.py:141: quarto>=0.2 is not available
SKIPPED [11] tests/test_mirror.py:168: sphinx_gallery is not available
SKIPPED [1] tests/test_mirror.py:219: sphinx_gallery is not available
SKIPPED [17] tests/test_contentsmanager.py:181: pandoc>=2.11 is not available
SKIPPED [7] tests/test_contentsmanager.py:204: quarto>=0.2 is not available
SKIPPED [2] tests/test_contentsmanager.py:1867: jupyterfs is not available
SKIPPED [1] tests/test_contentsmanager.py:1290: sphinx_gallery is not available
XFAIL tests/test_auto_ext.py::test_auto_from_kernelspecs_works[/home/tkloczko/rpmbuild/BUILD/jupytext-1.13.3/tests/notebooks/ipynb_sage/sage_print_hello.ipynb]
  reason: Sage notebooks have Python in their language_info metadata, see #727
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[python include=FALSE, active="Rmd"-language_and_metadata8] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r chunk_name, include=FALSE, active="Rmd"-language_and_metadata9] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}-language_and_metadata6] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r echo=FALSE-language_and_metadata3] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r plot_1, echo=TRUE-language_and_metadata4] - AssertionError:
============================================ 7 failed, 2560 passed, 110 skipped, 1 xfailed, 18167 warnings in 333.95s (0:05:33) ============================================
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle test failures — pytest documentation
With --pdb passed to pytest, the custom internal Pdb trace UI is used with both breakpoint() and failed tests/unhandled exceptions. --pdbcls can be...
Read more >
pytest-xdist - PyPI
The pytest-xdist plugin extends pytest with new test execution modes, the most used being distributing tests across multiple CPUs to speed up test...
Read more >
Changelog - pytest_cases
Improved compatibility with other pytest plugins, in particular pytest-repeat ... Fixed ValueError when @parametrize is used to parametrize a class.
Read more >
pytest Documentation - Read the Docs
How to re-run failed tests and maintain state between test runs . ... 2.17 How to use pytest with an existing test suite...
Read more >
15 amazing pytest plugins - Michael Kennedy - Test and Code
pytest plugins are an amazing way to supercharge your test suites, ... pytest-instafail; pytest-metadata; pytest-randomly; pytest-xdist ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found