Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.11.4: pytest is failing when pytest-randomly plugin is used #838

Closed
kloczek opened this issue Aug 21, 2021 · 12 comments · Fixed by #892
Closed

1.11.4: pytest is failing when pytest-randomly plugin is used #838

kloczek opened this issue Aug 21, 2021 · 12 comments · Fixed by #892

Comments

@kloczek
Copy link

kloczek commented Aug 21, 2021

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'
@kloczek kloczek changed the title 1.11.4: pytest is failing 1.11.4: pytest is failing in tests/test_cell_metadata.py uninits Aug 21, 2021
@mwouts
Copy link
Owner

mwouts commented Aug 31, 2021

Hi @kloczek , thank you for reporting this.

I must say that at the moment I am puzzled by your observation. The tests seem to be run with completely unadequate parameters! Take for instance this one:

____________________________________________________ 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)

I would expect that options, language_and_metadata should match

("r plot_1, echo=TRUE", ("R", {"name": "plot_1", "echo": True})),

but this is clearly not the case.

May I ask which version of pytest you are using? Do you think I could reproduce this on a standard Ubuntu machine? Thanks

@kloczek
Copy link
Author

kloczek commented Aug 31, 2021

Above output was with pytest 6.2.4.
Just tested 1.11.5 with latest pytest 6.2.6

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.11.5-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupytext-1.11.5-2.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.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=1120978200
rootdir: /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5
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, 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, anyio-3.3.0, asyncio-0.15.1, trio-0.7.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, Faker-8.12.1, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1
collected 2582 items

tests/test_header.py ..........                                                                                                                                      [  0%]
tests/test_pre_commit_2_sync_nbstripout.py s                                                                                                                         [  0%]
tests/test_read_simple_matlab.py ..                                                                                                                                  [  0%]
tests/test_black.py ...........s.                                                                                                                                    [  1%]
tests/test_escape_magics.py ................................................................................                                                         [  4%]
tests/test_execute.py ....s...                                                                                                                                       [  4%]
tests/test_using_cli.py .                                                                                                                                            [  4%]
tests/test_pre_commit_mode.py ............                                                                                                                           [  4%]
tests/test_cell_id.py .                                                                                                                                              [  4%]
tests/test_cm_config.py ............                                                                                                                                 [  5%]
tests/test_preserve_empty_cells.py .......                                                                                                                           [  5%]
tests/test_read_simple_groovy.py .                                                                                                                                   [  5%]
tests/test_read_simple_rmd.py .........                                                                                                                              [  6%]
tests/test_ipynb_to_py.py ....................                                                                                                                       [  6%]
tests/test_save_multiple.py .....................................................                                                                                    [  8%]
tests/test_metadata_filter.py .................                                                                                                                      [  9%]
tests/test_jupytext_errors.py ..                                                                                                                                     [  9%]
tests/test_ipynb_to_R.py ....                                                                                                                                        [  9%]
tests/test_read_simple_sphinx.py ...                                                                                                                                 [  9%]
tests/test_read_simple_ipynb.py .                                                                                                                                    [  9%]
tests/test_cell_metadata.py ........................F...........F.F..F...F.....F...FF...                                                                             [ 12%]
tests/test_metadata_filters_from_config.py .                                                                                                                         [ 12%]
tests/test_pep8.py ...................................................................................................................                               [ 16%]
tests/test_stringparser.py ....                                                                                                                                      [ 16%]
tests/test_pytest.py ..                                                                                                                                              [ 17%]
tests/test_read_simple_hydrogen.py .......                                                                                                                           [ 17%]
tests/test_unicode.py ...............................                                                                                                                [ 18%]
tests/test_read_all_py.py ..........................................................................................................                                 [ 22%]
tests/test_read_simple_rust.py ...                                                                                                                                   [ 22%]
tests/test_cli.py ............................s..............................ss................ss.....................s..........ss.....s..s........................ [ 28%]
.....................s.......................s..........s.........s........................s.....s...............s......s....................s.s.................... [ 34%]
.................................s.............................s.......s.........s..............s..s......                                                           [ 38%]
tests/test_compare.py .....................                                                                                                                          [ 39%]
tests/test_paired_paths.py ......................                                                                                                                    [ 40%]
tests/test_formats.py .........s...............                                                                                                                      [ 41%]
tests/test_read_simple_scheme.py .                                                                                                                                   [ 41%]
tests/test_jupytext_read.py ..                                                                                                                                       [ 41%]
tests/test_nbformat_version.py .......                                                                                                                               [ 41%]
tests/test_pre_commit_scripts.py .....s..                                                                                                                            [ 42%]
tests/test_config.py .................                                                                                                                               [ 42%]
tests/test_read_simple_pandoc.py sssss                                                                                                                               [ 42%]
tests/test_load_multiple.py ..                                                                                                                                       [ 43%]
tests/test_pre_commit_4_sync_execute.py s                                                                                                                            [ 43%]
tests/test_read_simple_python.py ................................................                                                                                    [ 44%]
tests/test_read_simple_markdown.py ....................................                                                                                              [ 46%]
tests/test_pre_commit_1_sync.py s                                                                                                                                    [ 46%]
tests/test_pre_commit_3_sync_black_nbstripout.py s                                                                                                                   [ 46%]
tests/test_read_simple_clojure.py .                                                                                                                                  [ 46%]
tests/test_read_simple_R.py ............                                                                                                                             [ 46%]
tests/test_combine.py ..................................................                                                                                             [ 48%]
tests/test_read_incomplete_rmd.py ...                                                                                                                                [ 48%]
tests/test_read_simple_percent.py ......................                                                                                                             [ 49%]
tests/test_ipynb_to_myst.py .....s.....s                                                                                                                             [ 50%]
tests/test_cells.py ...............                                                                                                                                  [ 50%]
tests/test_read_simple_nomarker.py ..                                                                                                                                [ 50%]
tests/test_rmd_to_ipynb.py ......                                                                                                                                    [ 51%]
tests/test_pre_commit_5_reformat_markdown.py s                                                                                                                       [ 51%]
tests/test_read_simple_java.py .                                                                                                                                     [ 51%]
tests/test_custom_cell_magics.py .                                                                                                                                   [ 51%]
tests/test_read_simple_julia.py .                                                                                                                                    [ 51%]
tests/test_markdown_in_code_cells.py ....                                                                                                                            [ 51%]
tests/test_read_simple_csharp.py .......                                                                                                                             [ 51%]
tests/test_doxygen.py ..........                                                                                                                                     [ 52%]
tests/test_mirror.py ..............s.....s...s.....s......s............................................s..............s....s..............s.................s.s..... [ 57%]
.s...................s.....s.......................................s...............ss...s..............s....................s.......................s............... [ 64%]
.........s...........................................s......ss.............s...ss....s...........s......                                                             [ 68%]
tests/test_read_folding_markers.py .....                                                                                                                             [ 68%]
tests/test_read_write_functions.py .....                                                                                                                             [ 68%]
tests/test_pre_commit_0_ipynb_to_py.py s                                                                                                                             [ 68%]
tests/test_knitr_spin.py .                                                                                                                                           [ 68%]
tests/test_read_dotnet_try_markdown.py ...                                                                                                                           [ 68%]
tests/test_ipynb_to_rmd.py ........................                                                                                                                  [ 69%]
tests/test_jupytext_nbconvert_round_trip.py .......................                                                                                                  [ 70%]
tests/test_auto_ext.py ................................................x.....................................s                                                       [ 73%]
tests/test_contentsmanager.py ...................s..............s.......................................................s........s.................................. [ 79%]
.......s...................................................s............................................s........s...s................s............................. [ 85%]
.....................s...s.......................s................s.......................s...........s...s.....................s.....s..............s.............. [ 91%]
....                                                                                                                                                                 [ 91%]
tests/test_write_does_not_modify_notebook.py ..............................................................................................................          [ 96%]
tests/test_trust_notebook.py ................................................                                                                                        [ 98%]
tests/test_isort.py .                                                                                                                                                [ 98%]
tests/test_changelog.py ...                                                                                                                                          [ 98%]
tests/test_active_cells.py ............................                                                                                                              [ 99%]
tests/test_cli_config.py ...........                                                                                                                                 [ 99%]
tests/test_hide_remove_input_outputs_rmarkdown.py ........                                                                                                           [100%]

================================================================================= FAILURES =================================================================================
____________________________________________ test_build_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_build_options(options, language_and_metadata):
>       compare(metadata_to_rmd_options(*language_and_metadata), options)

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

actual = 'r dpi=72, fig.path="fig_path/"', expected = 'r plot_1, 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           @@ -1 +1 @@
E           -r plot_1, dpi=72, fig.path="fig_path/"
E           +r dpi=72, fig.path="fig_path/"

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/jupytext/compare.py:47: AssertionError
___________________________________________ test_build_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2] ___________________________________________

options = 'r plot_1, bool=TRUE, fig.path="fig_path/"', language_and_metadata = ('R', {'bool': True, 'fig.path': 'fig_path/'})

    @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.5/tests/test_cell_metadata.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = 'r bool=TRUE, fig.path="fig_path/"', expected = 'r plot_1, bool=TRUE, 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           @@ -1 +1 @@
E           -r plot_1, bool=TRUE, fig.path="fig_path/"
E           +r bool=TRUE, fig.path="fig_path/"

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/jupytext/compare.py:47: AssertionError
_________________________________________ test_parse_rmd_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2] _________________________________________

options = 'r plot_1, bool=TRUE, fig.path="fig_path/"', language_and_metadata = ('R', {'bool': True, '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.5/tests/test_cell_metadata.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = ('R', {'bool': True, 'fig.path': 'fig_path/', 'name': 'plot_1'}), expected = ('R', {'bool': True, '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              "bool": true,
E           -  "fig.path": "fig_path/"
E           +  "fig.path": "fig_path/",
E           +  "name": "plot_1"
E             }
E            ]

/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/jupytext/compare.py:47: AssertionError
____________________________________________ 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.11.5/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.11.5/jupytext/compare.py:47: AssertionError
____________________________________________________ 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.5/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.5/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.5/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.5/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.11.5/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.11.5/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.5/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.5/jupytext/compare.py:47: AssertionError
============================================================================= warnings summary =============================================================================
jupytext/cell_reader.py:20
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_execute.py::test_execute
  /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[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: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_cli.py::test_cli_expect_errors
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_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_pre_commit_scripts.py::test_manual_call_of_pre_commit_hook
  [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_pre_commit_2_sync_nbstripout.py:14: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_black.py:68: autopep8 not found
SKIPPED [1] tests/test_execute.py:150: irkernel is not installed
SKIPPED [5] tests/test_cli.py:1005: 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 [1] tests/test_cli.py:1075: pandoc>=2.11 is not available
SKIPPED [3] tests/test_cli.py:991: 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_formats.py:324: pandoc>=2.11 is not available
SKIPPED [1] tests/test_pre_commit_scripts.py:335: 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:35: 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_read_simple_pandoc.py:82: Pandoc is installed
SKIPPED [1] tests/test_pre_commit_4_sync_execute.py:15: 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_pre_commit_3_sync_black_nbstripout.py:13: Jupytext folder is not a git repository #814
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_5_reformat_markdown.py:15: Jupytext folder is not a git repository #814
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_mirror.py:208: sphinx_gallery 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_auto_ext.py:36: No file_extension in language_info
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
XFAIL tests/test_auto_ext.py::test_auto_from_kernelspecs_works[/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_build_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2] - AssertionError:
FAILED tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2] - AssertionError:
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_parse_rmd_options[r plot_1, echo=TRUE-language_and_metadata4] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[r echo=FALSE-language_and_metadata3] - 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[python noname, tags=c("a", "b", "c"), echo={sum(a+c(1,2))>1}-language_and_metadata6] - AssertionError:
============================================== 8 failed, 2479 passed, 94 skipped, 1 xfailed, 57 warnings in 149.35s (0:02:29) ==============================================
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(<pr

@kloczek
Copy link
Author

kloczek commented Aug 31, 2021

Aftter deselecting above failing units I have another set fails.
Because I'm usomg pytest-randomly it may be showinmg that there are some dependencies beteeen units and changing to random order produces some random results.
Will try to repeat whole test with disabled randomisation.

+ /usr/bin/pytest -ra --deselect '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]' --deselect 'tests/test_cell_metadata.py::test_build_options[r echo=FALSE-language_and_metadata3]' --deselect 'tests/test_cell_metadata.py::test_build_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2]' --deselect 'tests/test_cell_metadata.py::test_build_options[r plot_1, dpi=72, fig.path="fig_path/"-language_and_metadata1]' --deselect 'tests/test_cell_metadata.py::test_parse_rmd_options[python include=FALSE, active="Rmd"-language_and_metadata8]' --deselect '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]' --deselect 'tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, bool=TRUE, fig.path="fig_path/"-language_and_metadata2]' --deselect 'tests/test_cell_metadata.py::test_parse_rmd_options[r plot_1, echo=TRUE-language_and_metadata4]'
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, 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=1386331291
rootdir: /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5
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, 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, anyio-3.3.0, asyncio-0.15.1, trio-0.7.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, Faker-8.12.1, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1
collected 2582 items / 8 deselected / 2574 selected

tests/test_pre_commit_0_ipynb_to_py.py s                                                                                                                             [  0%]
tests/test_pytest.py ..                                                                                                                                              [  0%]
tests/test_custom_cell_magics.py .                                                                                                                                   [  0%]
tests/test_markdown_in_code_cells.py ....                                                                                                                            [  0%]
tests/test_ipynb_to_py.py ....................                                                                                                                       [  1%]
tests/test_read_simple_csharp.py .......                                                                                                                             [  1%]
tests/test_contentsmanager.py ...............s...............................................................s...........s.s...s.................s.................. [  6%]
..........s.....s...........................................................................s.s...........s......................s.................................. [ 12%]
......s...s........s....s.s................s..........................................................s............................................s................ [ 19%]
....                                                                                                                                                                 [ 19%]
tests/test_trust_notebook.py ................................................                                                                                        [ 21%]
tests/test_cell_metadata.py ..................................F.....F...........                                                                                     [ 23%]
tests/test_read_simple_nomarker.py ..                                                                                                                                [ 23%]
tests/test_read_simple_python.py ................................................                                                                                    [ 25%]
tests/test_read_write_functions.py .....                                                                                                                             [ 25%]
tests/test_cell_id.py .                                                                                                                                              [ 25%]
tests/test_header.py ..........                                                                                                                                      [ 25%]
tests/test_read_simple_hydrogen.py .......                                                                                                                           [ 26%]
tests/test_jupytext_errors.py ..                                                                                                                                     [ 26%]
tests/test_pre_commit_5_reformat_markdown.py s                                                                                                                       [ 26%]
tests/test_write_does_not_modify_notebook.py ..............................................................................................................          [ 30%]
tests/test_read_simple_matlab.py ..                                                                                                                                  [ 30%]
tests/test_read_simple_rmd.py .........                                                                                                                              [ 31%]
tests/test_cells.py ...............                                                                                                                                  [ 31%]
tests/test_read_simple_scheme.py .                                                                                                                                   [ 31%]
tests/test_nbformat_version.py .......                                                                                                                               [ 31%]
tests/test_cli_config.py ...........                                                                                                                                 [ 32%]
tests/test_formats.py ......s..................                                                                                                                      [ 33%]
tests/test_read_simple_julia.py .                                                                                                                                    [ 33%]
tests/test_read_simple_percent.py ......................                                                                                                             [ 34%]
tests/test_cli.py ..................ss.s....s.s.........s..s.........s...............................s................s...s..........s...............s.............. [ 39%]
......s.s............................s.s.............................s............................................................s................................. [ 46%]
...................................s...s....s.......s.......s......s......s...............................                                                           [ 50%]
tests/test_read_simple_markdown.py ....................................                                                                                              [ 51%]
tests/test_pre_commit_3_sync_black_nbstripout.py s                                                                                                                   [ 51%]
tests/test_read_all_py.py ..........................................................................................................                                 [ 55%]
tests/test_active_cells.py ............................                                                                                                              [ 56%]
tests/test_using_cli.py .                                                                                                                                            [ 57%]
tests/test_jupytext_nbconvert_round_trip.py .......................                                                                                                  [ 57%]
tests/test_compare.py .....................                                                                                                                          [ 58%]
tests/test_metadata_filter.py .................                                                                                                                      [ 59%]
tests/test_stringparser.py ....                                                                                                                                      [ 59%]
tests/test_isort.py .                                                                                                                                                [ 59%]
tests/test_auto_ext.py ...............................s..........x............................................                                                       [ 62%]
tests/test_metadata_filters_from_config.py .                                                                                                                         [ 63%]
tests/test_read_dotnet_try_markdown.py ...                                                                                                                           [ 63%]
tests/test_read_simple_clojure.py .                                                                                                                                  [ 63%]
tests/test_pre_commit_1_sync.py s                                                                                                                                    [ 63%]
tests/test_read_folding_markers.py .....                                                                                                                             [ 63%]
tests/test_pre_commit_scripts.py .....s..                                                                                                                            [ 63%]
tests/test_unicode.py ...............................                                                                                                                [ 64%]
tests/test_pre_commit_2_sync_nbstripout.py s                                                                                                                         [ 64%]
tests/test_doxygen.py ..........                                                                                                                                     [ 65%]
tests/test_ipynb_to_rmd.py ........................                                                                                                                  [ 66%]
tests/test_read_simple_ipynb.py .                                                                                                                                    [ 66%]
tests/test_ipynb_to_myst.py ..........ss                                                                                                                             [ 66%]
tests/test_escape_magics.py ................................................................................                                                         [ 69%]
tests/test_hide_remove_input_outputs_rmarkdown.py ........                                                                                                           [ 70%]
tests/test_save_multiple.py .....................................................                                                                                    [ 72%]
tests/test_rmd_to_ipynb.py ......                                                                                                                                    [ 72%]
tests/test_read_simple_groovy.py .                                                                                                                                   [ 72%]
tests/test_execute.py ......s.                                                                                                                                       [ 72%]
tests/test_read_simple_rust.py ...                                                                                                                                   [ 72%]
tests/test_pre_commit_4_sync_execute.py s                                                                                                                            [ 72%]
tests/test_changelog.py ...                                                                                                                                          [ 73%]
tests/test_pre_commit_mode.py ............                                                                                                                           [ 73%]
tests/test_combine.py ..................................................                                                                                             [ 75%]
tests/test_read_simple_R.py ............                                                                                                                             [ 75%]
tests/test_read_simple_pandoc.py sssss                                                                                                                               [ 76%]
tests/test_load_multiple.py ..                                                                                                                                       [ 76%]
tests/test_read_simple_java.py .                                                                                                                                     [ 76%]
tests/test_config.py .................                                                                                                                               [ 76%]
tests/test_ipynb_to_R.py ....                                                                                                                                        [ 77%]
tests/test_black.py
 ...........s.                                                                                                                                    [ 77%]
tests/test_cm_config.py ............                                                                                                                                 [ 78%]
tests/test_knitr_spin.py .                                                                                                                                           [ 78%]
tests/test_preserve_empty_cells.py .......                                                                                                                           [ 78%]
tests/test_paired_paths.py ......................                                                                                                                    [ 79%]
tests/test_jupytext_read.py ..                                                                                                                                       [ 79%]
tests/test_mirror.py .........................s...........s...s............................................s............s......s............s....ss................. [ 84%]
.s..........................s....s.s.s......s...s......ss..s............s...........................s.............s.......s......s...s........................s..... [ 91%]
........s..............................s...................s.....................s......................                                                             [ 95%]
tests/test_read_incomplete_rmd.py ...                                                                                                                                [ 95%]
tests/test_read_simple_sphinx.py ...                                                                                                                                 [ 95%]
tests/test_pep8.py ...................................................................................................................                               [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________________ 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)

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            ]

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)

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"

jupytext/compare.py:47: AssertionError
============================================================================= warnings summary =============================================================================
jupytext/cell_reader.py:20
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_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_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::test_utf8_out_331
  [warning] 'contextfilter' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.

tests/test_cli.py::test_cli_expect_errors
tests/test_pre_commit_scripts.py::test_manual_call_of_pre_commit_hook
  [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_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]
  [warning] 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.

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_pre_commit_0_ipynb_to_py.py:16: Jupytext folder is not a git repository #814
SKIPPED [17] tests/test_contentsmanager.py:180: pandoc>=2.11 is not available
SKIPPED [2] tests/test_contentsmanager.py:1765: jupyterfs is not available
SKIPPED [1] tests/test_contentsmanager.py:1188: sphinx_gallery is not available
SKIPPED [1] tests/test_pre_commit_5_reformat_markdown.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_formats.py:324: 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:1075: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:795: sphinx_gallery is not available
SKIPPED [5] tests/test_cli.py:1005: pandoc>=2.11 is not available
SKIPPED [3] tests/test_cli.py:991: 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_3_sync_black_nbstripout.py:13: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_auto_ext.py:36: No file_extension in language_info
SKIPPED [1] tests/test_pre_commit_1_sync.py:17: 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_pre_commit_2_sync_nbstripout.py:14: Jupytext folder is not a git repository #814
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_execute.py:150: irkernel is not installed
SKIPPED [1] tests/test_pre_commit_4_sync_execute.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_read_simple_pandoc.py:50: pandoc>=2.11 is not available
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:64: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:82: Pandoc is installed
SKIPPED [1] tests/test_black.py:68: autopep8 not found
SKIPPED [17] tests/test_mirror.py:131: pandoc>=2.11 is not available
SKIPPED [11] tests/test_mirror.py:151: sphinx_gallery is not available
SKIPPED [1] tests/test_mirror.py:208: sphinx_gallery is not available
SKIPPED [1] tests/test_mirror.py:202: sphinx_gallery is not available
XFAIL tests/test_auto_ext.py::test_auto_from_kernelspecs_works[/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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 echo=FALSE-language_and_metadata3] - AssertionError:
FAILED tests/test_cell_metadata.py::test_build_options[python include=FALSE, active="Rmd"-language_and_metadata8] - AssertionError:
======================================= 2 failed, 2477 passed, 94 skipped, 8 deselected, 1 xfailed, 57 warnings in 229.48s (0:03:49) =======================================

@kloczek
Copy link
Author

kloczek commented Aug 31, 2021

Yep pytest is OK with disabled pytest-randomly

+ /usr/bin/pytest -ra -p no:randomly
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, 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)
rootdir: /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5
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, 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, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, Faker-8.12.1, nose2pytest-1.0.8, pyfakefs-4.5.1, tornado-0.8.1
collected 2582 items

tests/test_active_cells.py ............................                                                                                                              [  1%]
tests/test_auto_ext.py .............................................................x.s.......................                                                       [  4%]
tests/test_black.py ...s.........                                                                                                                                    [  4%]
tests/test_cell_id.py .                                                                                                                                              [  4%]
tests/test_cell_metadata.py ............................................................                                                                             [  7%]
tests/test_cells.py ...............                                                                                                                                  [  7%]
tests/test_changelog.py ...                                                                                                                                          [  8%]
tests/test_cli.py .................................................................................................................................................. [ 13%]
........................................................sssssssssssssss............................................................................................. [ 20%]
s........................................................................ssssssss...s....s................                                                           [ 24%]
tests/test_cli_config.py ...........                                                                                                                                 [ 24%]
tests/test_cm_config.py ............                                                                                                                                 [ 25%]
tests/test_combine.py ..................................................                                                                                             [ 26%]
tests/test_compare.py .....................                                                                                                                          [ 27%]
tests/test_config.py .................                                                                                                                               [ 28%]
tests/test_contentsmanager.py ...................................................sssssssssssssssss.................................................................. [ 33%]
.................................................................................................................................................................... [ 39%]
................................................................................................................................s................................... [ 46%]
..ss                                                                                                                                                                 [ 46%]
tests/test_custom_cell_magics.py .                                                                                                                                   [ 46%]
tests/test_doxygen.py ..........                                                                                                                                     [ 46%]
tests/test_escape_magics.py ................................................................................                                                         [ 50%]
tests/test_execute.py ......s.                                                                                                                                       [ 50%]
tests/test_formats.py ......................s..                                                                                                                      [ 51%]
tests/test_header.py ..........                                                                                                                                      [ 51%]
tests/test_hide_remove_input_outputs_rmarkdown.py ........                                                                                                           [ 51%]
tests/test_ipynb_to_R.py ....                                                                                                                                        [ 52%]
tests/test_ipynb_to_myst.py .......ss...                                                                                                                             [ 52%]
tests/test_ipynb_to_py.py ....................                                                                                                                       [ 53%]
tests/test_ipynb_to_rmd.py ........................                                                                                                                  [ 54%]
tests/test_isort.py .                                                                                                                                                [ 54%]
tests/test_jupytext_errors.py ..                                                                                                                                     [ 54%]
tests/test_jupytext_nbconvert_round_trip.py .......................                                                                                                  [ 55%]
tests/test_jupytext_read.py ..                                                                                                                                       [ 55%]
tests/test_knitr_spin.py .                                                                                                                                           [ 55%]
tests/test_load_multiple.py ..                                                                                                                                       [ 55%]
tests/test_markdown_in_code_cells.py ....                                                                                                                            [ 55%]
tests/test_metadata_filter.py .................                                                                                                                      [ 56%]
tests/test_metadata_filters_from_config.py .                                                                                                                         [ 56%]
tests/test_mirror.py ............................................................................................................................................... [ 61%]
..................................................................................sssssssssssssssss..........................................sssssssssss............ [ 68%]
...ss...................................................................................................                                                             [ 72%]
tests/test_nbformat_version.py .......                                                                                                                               [ 72%]
tests/test_paired_paths.py ......................                                                                                                                    [ 73%]
tests/test_pep8.py ...................................................................................................................                               [ 77%]
tests/test_pre_commit_0_ipynb_to_py.py s                                                                                                                             [ 77%]
tests/test_pre_commit_1_sync.py s                                                                                                                                    [ 77%]
tests/test_pre_commit_2_sync_nbstripout.py s                                                                                                                         [ 77%]
tests/test_pre_commit_3_sync_black_nbstripout.py s                                                                                                                   [ 78%]
tests/test_pre_commit_4_sync_execute.py s                                                                                                                            [ 78%]
tests/test_pre_commit_5_reformat_markdown.py s                                                                                                                       [ 78%]
tests/test_pre_commit_mode.py ............                                                                                                                           [ 78%]
tests/test_pre_commit_scripts.py .......s                                                                                                                            [ 78%]
tests/test_preserve_empty_cells.py .......                                                                                                                           [ 79%]
tests/test_pytest.py ..                                                                                                                                              [ 79%]
tests/test_read_all_py.py ..........................................................................................................                                 [ 83%]
tests/test_read_dotnet_try_markdown.py ...                                                                                                                           [ 83%]
tests/test_read_folding_markers.py .....                                                                                                                             [ 83%]
tests/test_read_incomplete_rmd.py ...                                                                                                                                [ 83%]
tests/test_read_simple_R.py ............                                                                                                                             [ 84%]
tests/test_read_simple_clojure.py .                                                                                                                                  [ 84%]
tests/test_read_simple_csharp.py .......                                                                                                                             [ 84%]
tests/test_read_simple_groovy.py .                                                                                                                                   [ 84%]
tests/test_read_simple_hydrogen.py .......                                                                                                                           [ 84%]
tests/test_read_simple_ipynb.py .                                                                                                                                    [ 84%]
tests/test_read_simple_java.py .                                                                                                                                     [ 84%]
tests/test_read_simple_julia.py .                                                                                                                                    [ 84%]
tests/test_read_simple_markdown.py ....................................                                                                                              [ 86%]
tests/test_read_simple_matlab.py ..                                                                                                                                  [ 86%]
tests/test_read_simple_nomarker.py ..                                                                                                                                [ 86%]
tests/test_read_simple_pandoc.py sssss                                                                                                                               [ 86%]
tests/test_read_simple_percent.py ......................                                                                                                             [ 87%]
tests/test_read_simple_python.py ................................................                                                                                    [ 89%]
tests/test_read_simple_rmd.py .........                                                                                                                              [ 89%]
tests/test_read_simple_rust.py ...                                                                                                                                   [ 89%]
tests/test_read_simple_scheme.py .                                                                                                                                   [ 89%]
tests/test_read_simple_sphinx.py ...                                                                                                                                 [ 90%]
tests/test_read_write_functions.py .....                                                                                                                             [ 90%]
tests/test_rmd_to_ipynb.py ......                                                                                                                                    [ 90%]
tests/test_save_multiple.py .....................................................                                                                                    [ 92%]
tests/test_stringparser.py ....                                                                                                                                      [ 92%]
tests/test_trust_notebook.py ................................................                                                                                        [ 94%]
tests/test_unicode.py ...............................                                                                                                                [ 95%]
tests/test_using_cli.py .                                                                                                                                            [ 95%]
tests/test_write_does_not_modify_notebook.py ..............................................................................................................          [100%]

============================================================================= warnings summary =============================================================================
jupytext/cell_reader.py:20
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_cli.py::test_utf8_out_331
  /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_cli.py::test_cli_expect_errors
  /home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/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_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_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]
  [warning] 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.

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

tests/test_pre_commit_scripts.py::test_manual_call_of_pre_commit_hook
  [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)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
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 [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:1075: pandoc>=2.11 is not available
SKIPPED [1] tests/test_cli.py:1188: Please run 'python -m ipykernel install --name python_kernel --user'
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_execute.py:150: irkernel is not installed
SKIPPED [1] tests/test_formats.py:324: pandoc>=2.11 is not available
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 [17] tests/test_mirror.py:131: pandoc>=2.11 is not available
SKIPPED [11] tests/test_mirror.py:151: sphinx_gallery is not available
SKIPPED [1] tests/test_mirror.py:202: sphinx_gallery is not available
SKIPPED [1] tests/test_mirror.py:208: sphinx_gallery 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_pre_commit_1_sync.py:17: Jupytext folder is not a git repository #814
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_pre_commit_4_sync_execute.py:15: Jupytext folder is not a git repository #814
SKIPPED [1] tests/test_pre_commit_5_reformat_markdown.py:15: 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_read_simple_pandoc.py:13: pandoc>=2.11 is not available
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:64: pandoc>=2.11 is not available
SKIPPED [1] tests/test_read_simple_pandoc.py:82: Pandoc is installed
XFAIL tests/test_auto_ext.py::test_auto_from_kernelspecs_works[/home/tkloczko/rpmbuild/BUILD/jupytext-1.11.5/tests/notebooks/ipynb_sage/sage_print_hello.ipynb]
  reason: Sage notebooks have Python in their language_info metadata, see #727
=================================================== 2487 passed, 94 skipped, 1 xfailed, 57 warnings in 156.47s (0:02:36) ===================================================
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()'.

If you want to fix that kind of issues you need to use https://github.com/mrbean-bremen/pytest-find-dependencies/

@kloczek kloczek changed the title 1.11.4: pytest is failing in tests/test_cell_metadata.py uninits 1.11.4: pytest is failing when pytest-randomly plugin is used Aug 31, 2021
@kloczek
Copy link
Author

kloczek commented Aug 31, 2021

In other words there are still two minor issues:

  • test suite has some dependencies between units (it is important to not have such dependencies if you want to execute exact unit or set of units)
  • there are still some pytest warnings

@mwouts
Copy link
Owner

mwouts commented Aug 31, 2021

Hi @kloczek , yes last time I took a note about warnings at #823, but I've had no time to make progress there (and I am still willing to)

I am a bit surprised that the tests above show dependencies between units. What I think I saw in the first error above was something different, like an incorrect parameterization - I have prepared input and outputs as a list of tuple, but these inputs+outputs don't seem to be presented in pairs to the test function. Do you have a clue of what is happening there? Thanks!

@kloczek
Copy link
Author

kloczek commented Sep 1, 2021

That is fine. This issue is not critical but kind of minior.
Feel free to close as duplicate :)

@kloczek
Copy link
Author

kloczek commented 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) ============================================

@mwouts
Copy link
Owner

mwouts commented Dec 4, 2021

Hi @kloczek , sorry I still haven't find the time to fix this - I hope to unpile this issue in the coming weeks.

@kloczek
Copy link
Author

kloczek commented Dec 4, 2021

No ruch .. for now I'm testing with -p no:randomly :)

@kloczek
Copy link
Author

kloczek commented Dec 10, 2021

I've tested 40b122c and lookd like it works.

Thank you :)

@mwouts
Copy link
Owner

mwouts commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants