Skip to content

3 tests fail #804

Description

@yurivict
============================================================================================== FAILURES ==============================================================================================
_______________________________________________________________________________ TestControlledDict.test_update_allowed _______________________________________________________________________________

self = <tests.test_collections.TestControlledDict object at 0x2259d720dee0>

    def test_update_allowed(self):
        dct = ControlledDict(a=1)
        dct._allow_update = True
    
        dct["a"] = 2
        assert dct["a"] == 2
    
        dct.update({"a": 3})
        assert dct["a"] == 3
    
        # Test Iterator handling
>       dct.update(zip(["c", "d"], [11, 12]))

test_collections.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = {'a': 3}, args = (<zip object at 0x2259e117ea80>,), kwargs = {}, updates = {'c': 11, 'd': 12}, key = 'c'

    def update(self, *args, **kwargs) -> None:
        """Forbid adding or updating keys based on _allow_add and _allow_update."""
        # Materialize once so iterators are not consumed twice between
        # validation and the actual update.
        updates = dict(*args, **kwargs)
        if not (self._allow_add and self._allow_update):
            for key in updates:
                if key not in self and not self._allow_add:
>                   raise TypeError(
                        f"Cannot add new key {key!r} using update, because add is disabled."
                    )
E                   TypeError: Cannot add new key 'c' using update, because add is disabled.

../../stage/usr/local/lib/python3.12/site-packages/monty/collections.py:96: TypeError
_____________________________________________________________________________________ TestCheckType.test_pandas ______________________________________________________________________________________

self = <tests.test_json.TestCheckType object at 0x2259e10e4530>

    @pytest.mark.skipif(pd is None, reason="pandas is not installed")
    def test_pandas(self):
        # Test pandas DataFrame
        df = pd.DataFrame({"a": [1, 2, 3]})
    
>       assert _check_type(df, "pandas.DataFrame")
E       AssertionError: assert False
E        +  where False = _check_type(   a\n0  1\n1  2\n2  3, 'pandas.DataFrame')

test_json.py:1401: AssertionError
__________________________________________________________________________________ TestCheckType.test_extended_json __________________________________________________________________________________

self = <tests.test_json.TestCheckType object at 0x2259e106f050>

    @pytest.mark.skipif(ObjectId is None, reason="bson not present")
    @pytest.mark.skipif(json_util is None, reason="pymongo not present")
    def test_extended_json(self):
        ext_json_dict = {
            "datetime": datetime.datetime.now(datetime.UTC),
            "NaN": float("NaN"),
            "infinity": float("inf"),
            "-infinity": -float("inf"),
        }
        ext_json_str = json_util.dumps(ext_json_dict)
    
        not_serialized = json.loads(ext_json_str)
>       assert all(isinstance(v, dict) for v in not_serialized.values())
E       assert False
E        +  where False = all(<generator object TestCheckType.test_extended_json.<locals>.<genexpr> at 0x2259ec68edc0>)

test_json.py:1453: AssertionError
========================================================================================== warnings summary ==========================================================================================
../../../../../../local/lib/python3.12/site-packages/bson/__init__.py:112
  /usr/local/lib/python3.12/site-packages/bson/__init__.py:112: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    EPOCH_NAIVE = datetime.datetime.utcfromtimestamp(0)

../../../../../../local/lib/python3.12/site-packages/torch/cuda/__init__.py:64
  /usr/local/lib/python3.12/site-packages/torch/cuda/__init__.py:64: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
    import pynvml  # type: ignore[import]

tests/test_subprocess.py::test_command
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/subprocess.py:50: FutureWarning: is_string is deprecated, and will be removed on 2028-01-01
  Use isinstance(s, str) instead.
    if is_string(command):

tests/test_fractions.py::test_gcd
  /usr/ports/devel/py-monty/work-py312/monty-2026.7.16/tests/test_fractions.py:9: FutureWarning: gcd is deprecated, and will be removed on 2028-01-01
  Use math.gcd instead.
    assert gcd(7, 14, 63) == 7

tests/test_fractions.py::test_lcm
  /usr/ports/devel/py-monty/work-py312/monty-2026.7.16/tests/test_fractions.py:13: FutureWarning: lcm is deprecated, and will be removed on 2028-01-01
  Use math.lcm instead.
    assert lcm(2, 3, 4) == 12

tests/test_dev.py::test_install_except_hook
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/dev.py:206: DeprecationWarning: Deprecated since IPython 9.0 use FormattedTB directly ColorTB is just an alias
    sys.excepthook = hook(**kwargs)

tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
tests/test_multiprocessing.py::test_imap_tqdm
  /usr/local/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=43705) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

tests/test_math.py::test_nPr
  /usr/ports/devel/py-monty/work-py312/monty-2026.7.16/tests/test_math.py:11: FutureWarning: nPr is deprecated, and will be removed on 2028-01-01
  Use math.perm instead.
    assert nPr(4, 2) == 12

tests/test_math.py::test_nCr
  /usr/ports/devel/py-monty/work-py312/monty-2026.7.16/tests/test_math.py:7: FutureWarning: nCr is deprecated, and will be removed on 2028-01-01
  Use math.comb instead.
    assert nCr(4, 2) == 6

tests/test_benchmarks.py::test_bench_lcm_many
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:109: FutureWarning: lcm is deprecated, and will be removed on 2028-01-01
  Use math.lcm instead.
    function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_lcm_many
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:209: FutureWarning: lcm is deprecated, and will be removed on 2028-01-01
  Use math.lcm instead.
    function_result = function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_nCr_large
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:109: FutureWarning: nCr is deprecated, and will be removed on 2028-01-01
  Use math.comb instead.
    function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_nCr_large
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:209: FutureWarning: nCr is deprecated, and will be removed on 2028-01-01
  Use math.comb instead.
    function_result = function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_nPr_large
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:109: FutureWarning: nPr is deprecated, and will be removed on 2028-01-01
  Use math.perm instead.
    function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_nPr_large
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:209: FutureWarning: nPr is deprecated, and will be removed on 2028-01-01
  Use math.perm instead.
    function_result = function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_gcd_many
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:109: FutureWarning: gcd is deprecated, and will be removed on 2028-01-01
  Use math.gcd instead.
    function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_gcd_many
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:209: FutureWarning: gcd is deprecated, and will be removed on 2028-01-01
  Use math.gcd instead.
    function_result = function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_is_string_false
tests/test_benchmarks.py::test_bench_is_string_true
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:109: FutureWarning: is_string is deprecated, and will be removed on 2028-01-01
  Use isinstance(s, str) instead.
    function_to_benchmark(*args, **kwargs)

tests/test_benchmarks.py::test_bench_is_string_false
tests/test_benchmarks.py::test_bench_is_string_true
  /usr/local/lib/python3.12/site-packages/pytest_benchmark/fixture.py:209: FutureWarning: is_string is deprecated, and will be removed on 2028-01-01
  Use isinstance(s, str) instead.
    function_result = function_to_benchmark(*args, **kwargs)

tests/test_tempfile.py::TestScratchDir::test_with_copy_gzip
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/tempfile.py:134: UserWarning: Both scratch_text and scratch_text.gz exist.
    gzip_dir(self.tempdir)

tests/test_tempfile.py::TestScratchDir::test_with_copy_gzip
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/tempfile.py:134: UserWarning: Both pre_scratch_text and pre_scratch_text.gz exist.
    gzip_dir(self.tempdir)

tests/test_tempfile.py::TestScratchDir::test_with_copy_gzip
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/tempfile.py:134: UserWarning: Both 3000_lines.txt.bz2 and 3000_lines.txt.bz2.gz exist.
    gzip_dir(self.tempdir)

tests/test_tempfile.py::TestScratchDir::test_with_copy_gzip
  /usr/ports/devel/py-monty/work-py312/stage/usr/local/lib/python3.12/site-packages/monty/tempfile.py:134: UserWarning: Both empty_file.txt and empty_file.txt.gz exist.
    gzip_dir(self.tempdir)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

------------------------------------------------------------------------------------------------------------------------ benchmark: 29 tests -------------------------------------------------------------------------------------------------------------------------
Name (time in ns)                                       Min                         Max                       Mean                     StdDev                     Median                         IQR            Outliers             OPS            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_bench_frozendict_init                         258.4507 (1.0)            1,141.5003 (1.0)             266.4964 (1.0)              10.4479 (1.0)             266.0003 (1.0)                0.9997 (1.0)     1200;5231  3,752,395.9024 (1.0)      191206          20
test_bench_is_string_true                          548.9856 (2.12)          16,950.0127 (14.85)           584.1636 (2.19)             64.0048 (6.13)            580.9998 (2.18)              10.0117 (10.01)    129;1980  1,711,849.1663 (0.46)     147929           1
test_bench_is_string_false                         559.9868 (2.17)          17,341.0226 (15.19)           588.9381 (2.21)            101.9804 (9.76)            589.9929 (2.22)              10.9721 (10.98)     44;1605  1,697,971.4046 (0.45)      56466           1
test_bench_deprecated_call                         560.0159 (2.17)          17,459.9991 (15.30)           590.9234 (2.22)             69.7068 (6.67)            589.9929 (2.22)              10.0117 (10.01)     67;2611  1,692,266.6273 (0.45)      68776           1
test_bench_gcd_many                                780.0118 (3.02)          17,370.0100 (15.22)           816.7261 (3.06)            107.4982 (10.29)           811.0073 (3.05)              10.0117 (10.01)      31;796  1,224,400.6641 (0.33)      25336           1
test_bench_list_strings_list                     1,336.0986 (5.17)           3,125.1024 (2.74)          1,363.7977 (5.12)             34.2927 (3.28)          1,362.1000 (5.12)               7.0046 (7.01)    1141;3846    733,246.5908 (0.20)      72887          10
test_bench_zpath                                 1,348.9916 (5.22)          61,260.9729 (53.67)         1,410.4843 (5.29)            276.0834 (26.42)         1,400.0107 (5.26)              19.9943 (20.00)   1509;4119    708,976.3449 (0.19)     152439           1
test_bench_nPr_large                             1,389.0094 (5.37)           8,179.9808 (7.17)          1,447.7251 (5.43)            153.4010 (14.68)         1,430.0167 (5.38)              28.9874 (29.00)     150;274    690,738.8654 (0.18)      14414           1
test_bench_from_dict                             1,499.9823 (5.80)          18,320.0173 (16.05)         1,563.0454 (5.87)            108.0093 (10.34)         1,559.9944 (5.86)              20.0234 (20.03)    324;2329    639,776.6868 (0.17)     162841           1
test_bench_lcm_many                              1,640.0008 (6.35)          17,620.0119 (15.44)         1,714.6173 (6.43)            137.2600 (13.14)         1,700.0129 (6.39)              39.9887 (40.00)     360;643    583,220.5154 (0.16)      30855           1
test_bench_nCr_large                             1,819.9789 (7.04)          17,619.9828 (15.44)         1,878.7130 (7.05)            154.5819 (14.80)         1,861.0153 (7.00)              21.0130 (21.02)    674;1124    532,279.2644 (0.14)      54084           1
test_bench_as_dict                               2,070.0099 (8.01)          47,251.0001 (41.39)         2,142.1184 (8.04)            259.4085 (24.83)         2,129.9929 (8.01)              20.0234 (20.03)    671;1734    466,827.6078 (0.12)      64513           1
test_bench_caller_name                           2,910.0047 (11.26)         19,739.9931 (17.29)         3,000.9475 (11.26)           205.9007 (19.71)         2,991.0007 (11.24)             30.0060 (30.01)     111;772    333,228.0913 (0.09)      27617           1
test_bench_cached_class_init                     4,279.9802 (16.56)         21,459.0109 (18.80)         4,406.6137 (16.54)           177.7146 (17.01)         4,400.0044 (16.54)             50.0295 (50.04)     154;479    226,931.6221 (0.06)      24079           1
test_bench_to_json                               6,429.9966 (24.88)         30,491.0063 (26.71)         6,586.0561 (24.71)           374.4213 (35.84)         6,560.0034 (24.66)             58.9935 (59.01)     243;411    151,835.9367 (0.04)      15447           1
test_bench_regrep_terminate                      7,919.9963 (30.64)         24,690.9913 (21.63)         8,109.9247 (30.43)           315.0342 (30.15)         8,089.9918 (30.41)             69.0052 (69.02)     335;535    123,305.7070 (0.03)      18094           1
test_bench_montydecoder_process                 15,369.9948 (59.47)         32,590.0037 (28.55)        15,598.2968 (58.53)           332.7980 (31.85)        15,570.9859 (58.54)             89.9890 (90.01)    706;1050     64,109.5637 (0.02)      36193           1
test_bench_jsanitize_plain                      18,369.9885 (71.08)         37,149.9918 (32.54)        18,842.3221 (70.70)           414.6267 (39.69)        18,829.0142 (70.79)            179.0177 (179.07)    583;680     53,072.0149 (0.01)      26617           1
test_bench_attrdict_set                         23,330.9984 (90.27)         41,211.0239 (36.10)        23,780.2866 (89.23)           451.8668 (43.25)        23,739.9945 (89.25)            190.0480 (190.10)   857;1123     42,051.6379 (0.01)      27763           1
test_bench_iuptri                               28,620.0084 (110.74)        51,700.9757 (45.29)        28,970.8056 (108.71)          566.5457 (54.23)        28,920.0107 (108.72)           119.0056 (119.04)    218;418     34,517.5075 (0.01)       6922           1
test_bench_wildcard_match                       63,359.9993 (245.15)       106,001.0109 (92.86)        64,447.5164 (241.83)          913.7048 (87.45)        64,360.9965 (241.96)           270.9858 (271.06)    183;823     15,516.5017 (0.00)      13497           1
test_bench_montyencoder_default_ndarray        124,732.0033 (482.61)       166,661.0187 (146.00)      125,541.8313 (471.08)        1,180.1996 (112.96)      125,382.0083 (471.36)           470.0269 (470.16)     55;141      7,965.4725 (0.00)       3585           1
test_bench_loadfn_yaml                         303,301.9893 (>1000.0)      355,922.9954 (311.80)      312,159.1071 (>1000.0)       3,696.3671 (353.79)      311,861.9934 (>1000.0)        3,740.0023 (>1000.0)    270;21      3,203.4946 (0.00)       1604           1
test_bench_import_monty_json                   471,934.0068 (>1000.0)    2,183,137.0250 (>1000.0)     567,071.3369 (>1000.0)     175,875.4666 (>1000.0)     512,273.9822 (>1000.0)       99,890.2397 (>1000.0)     19;19      1,763.4466 (0.00)        471           1
test_bench_dumpfn_jsonl                        544,895.0105 (>1000.0)      601,144.9732 (526.63)      551,313.7201 (>1000.0)       4,403.8532 (421.51)      550,263.9979 (>1000.0)        3,496.4687 (>1000.0)   214;121      1,813.8493 (0.00)       1573           1
test_bench_find_exts                         1,110,598.0084 (>1000.0)    1,159,230.0143 (>1000.0)   1,118,413.3396 (>1000.0)       3,872.9768 (370.69)    1,117,789.0119 (>1000.0)        1,872.5041 (>1000.0)     34;34        894.1238 (0.00)        673           1
test_bench_jsanitize_strict_ndarray          1,316,620.9974 (>1000.0)    1,713,534.0022 (>1000.0)   1,359,550.9003 (>1000.0)      45,420.6383 (>1000.0)   1,338,310.5106 (>1000.0)       10,199.0008 (>1000.0)   130;135        735.5370 (0.00)        634           1
test_bench_regrep                            8,888,280.0192 (>1000.0)  164,054,124.9944 (>1000.0)  48,406,948.6661 (>1000.0)  54,660,923.8536 (>1000.0)   9,264,713.0077 (>1000.0)  107,852,747.7657 (>1000.0)      26;0         20.6582 (0.00)         75           1
test_bench_reverse_readline                 12,775,601.9938 (>1000.0)   13,078,202.9883 (>1000.0)  12,855,365.6471 (>1000.0)      42,406.8202 (>1000.0)  12,853,661.9886 (>1000.0)       30,894.4873 (>1000.0)      15;6         77.7885 (0.00)         77           1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean
============================================================================ 3 failed, 248 passed, 32 warnings in 23.95s =============================================================================
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=14 encoding='UTF-8'>

Version: 2026.7.16
Python-3.12
FreeBSD 15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions