Age | Commit message (Collapse) | Author |
|
PiperOrigin-RevId: 478521309
Change-Id: Ica34fdda749b928fcf73e030bc3fa4e1585a753c
|
|
PiperOrigin-RevId: 475611494
Change-Id: I9facdfcaece0b3c0bd2b0b38364ecd41cb06d79c
|
|
PiperOrigin-RevId: 474195462
Change-Id: I2b57d8ea6b8eb66d1f777f026fb19e5401983789
|
|
PiperOrigin-RevId: 473306343
Change-Id: I4c166f7fa34ce2f1b0bcacafbf790d4f932886d1
|
|
This change tweaks the formatting used for outputting elapsed time duration values for testsuite and testcase nodes in the XML output file produced by `TextAndXMLTestRunner` to allow for visibility down to milliseconds of precision.
This also aligns with C++ https://github.com/google/googletest
PiperOrigin-RevId: 470750030
Change-Id: If940033e0e44adf95ff3bf43125c185f438b8d8e
|
|
PiperOrigin-RevId: 470123526
Change-Id: I6b5f20518c05e29a413cab9a331a69c769c8f355
|
|
This also makes sphinx autodoc generate docs for exposed APIs.
Also make `absl.flags`'s docstring compatible with reST.
PiperOrigin-RevId: 469768218
Change-Id: I6fd3807de05d6803a0aa73b3872555e53d504e8d
|
|
`assertRaisesWithLiteralMatch` method to also store the caught exception object in the returned context manager's `exception` attribute.
PiperOrigin-RevId: 468744160
Change-Id: Iebc6e20d2084d1d078f5dd989d705209a94e1e45
|
|
to add generated docs by Sphinx/readthedocs.
This is just an initial pass, far from great documentations.
PiperOrigin-RevId: 468721475
Change-Id: I5b4f9b2127add933d7eb56414b4fa1751cdacb3d
|
|
PiperOrigin-RevId: 463213585
Change-Id: Ibeea24bb64c116ab5a998032910a033f1c0c08a4
|
|
an iterable of concrete enum values are used as the default.
PiperOrigin-RevId: 461656002
Change-Id: Ic6d0699ad4f507d9f6ae24ab4aad0d7b8b19bd63
|
|
https://github.com/python/cpython/pull/28180.
After the change, the errors from the test case were no longer buffered in `_Outcome`. Instead, we need to take a note of errors on the `TestResult` before, then compare errors after.
PiperOrigin-RevId: 461070558
Change-Id: I7d9f769cd46143a886bc5edeb224804acd8dbaf9
|
|
PiperOrigin-RevId: 454734291
Change-Id: I043f77b129a411a9f517b37800df3ea729cb7a59
|
|
`absltest.main()` is called inside `app.run()`.
We just want to remove the defined flags from the original `sys.argv` without affect anything. At that point, flags are already parsed by `app.run()`.
The original code also has an issue with validators and multi- flags. Calling `FLAGS(sys.argv)` will duplicate the flag values then run flag validators, which can fail before the flag values are restored.
PiperOrigin-RevId: 454052335
Change-Id: I24a3af6bb3c68dbc17ebc54a2c99e08b1a10d60a
|
|
PiperOrigin-RevId: 453697925
Change-Id: I24a9fbbe2a690d7101b7190f4b4976d16bd0942f
|
|
Now that we've dropped Python 2 support, we can drop the conditional import of `typing`.
PiperOrigin-RevId: 450471818
Change-Id: I6c4efc7b6943b9794b2a3cf1eba90d330d6b73fd
|
|
PiperOrigin-RevId: 447005334
Change-Id: Iea86a969093640a18663d3d135648329c45e9954
|
|
PiperOrigin-RevId: 446842401
Change-Id: Ic66c537d810dda858318a95e5f7b2242f58f7c75
|
|
PiperOrigin-RevId: 440945020
Change-Id: I78d78173ca4a122208950176104e9ae722616e42
|
|
Also remove the mock package in bazel WORKSPACE file.
PiperOrigin-RevId: 436585035
Change-Id: I7f8eafac5f7b10dc8f580db20c7ae60711dfdf12
|
|
PiperOrigin-RevId: 436293697
Change-Id: I4ebf90127a781162636fa728c8899d76937dbca6
|
|
PiperOrigin-RevId: 436216380
Change-Id: I1058b3893eaf6e18c2872c2cf2533c3109bb972f
|
|
The test helper change is for a test that will be released in a future version.
PiperOrigin-RevId: 435099266
Change-Id: I870a7a6386f5ecca4e349b1211b92c723dfd8c54
|
|
PiperOrigin-RevId: 432505574
Change-Id: I581809fc35b40fd477a111154065a281c53eee00
|
|
PiperOrigin-RevId: 430280700
Change-Id: I62ca45c7b794989f9e8ee66094fb73c5ac7a6840
|
|
bool context (not useful) to avoid situations where someone really wanted to refer to `their_flag.value` instead. This prevents logic bugs.
There were ~10 problems found by this and cleaned up in our internal codebase.
PiperOrigin-RevId: 427295923
Change-Id: Ifc9e086133986cc14d052a06889a93c1ab0ff688
|
|
PiperOrigin-RevId: 426998346
Change-Id: I6b7ad5496864aee2bfff9b7cdff4ed70fd790a34
|
|
PiperOrigin-RevId: 426506531
Change-Id: I7a291ac06fc88c9970d58241538a7bdc3ffd7fa4
|
|
PiperOrigin-RevId: 423878454
Change-Id: Iadc82651ecd39954cfd2af6b4bae2a98388fd75b
|
|
Python 2 support.
PiperOrigin-RevId: 423364637
Change-Id: I700992249af0b0a17cddedf45f5969905bc5a954
|
|
PiperOrigin-RevId: 423095241
Change-Id: Ie78fb886746b11320e777587bf50c938d9054e37
|
|
PiperOrigin-RevId: 410287536
Change-Id: I50b3999e8da21aefa65314a121fddf8e832d57b0
|
|
these functions are not, not in _validators.py.
PiperOrigin-RevId: 407853170
Change-Id: Iff13f2a1ca391109f9a7e85f2a91abbe3cba3c53
|
|
PiperOrigin-RevId: 406169399
Change-Id: Ib52043ca4b5902b3fc3915a97568626fbfc755b6
|
|
PiperOrigin-RevId: 405738888
Change-Id: I8d74a26f6ef33d8e0b3fabb8a5f1227e65e81ef9
|
|
Also removed a few `six.PY2` protected methods in absltest since the linter recognizes the super class and reports the use of deprecated methods errors.
PiperOrigin-RevId: 405723651
Change-Id: I60835dd7b30695c7c35613080621a0cbdebe890f
|
|
end-of-life for more than a year now.
PiperOrigin-RevId: 405511743
Change-Id: Id0f78693a6de9474576c3cfa879caf2cc177d8f6
|
|
PiperOrigin-RevId: 404282150
Change-Id: I3600a465b46e634e1f20fb7d33e49bc4280f7a29
|
|
expected.
Example: `bazel test absl:tests/python_version_test --test_arg=--expected_version=3.10.0`
PiperOrigin-RevId: 402933630
Change-Id: Ib62d9c21ec93cab5bd657bcd4c88ed2881583850
|
|
`--test_filter=` flag (Python 3.7+ only).
Previously, the `--test_filter=` arguments are passed to Python's unittest as positional arguments. This only matches by class or method's full names.
After this, `--test_filter=` has the same meaning as unittest's `-k` flag: https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k
One notable behavior difference: previously if the filter doesn't match any tests, the test would fail; now it doesn't fail.
This also makes filtering `absltest.parameterized` tests significantly more user friendly.
This change is only for Python 3.7+.
PiperOrigin-RevId: 401582298
Change-Id: I074e9283706fe9c88a8dbb392084fb6548cebc6f
|
|
the `PATH` variable.
The `PATH` variable is needed to correctly run the Python version determined by bazel, since the `py_binary` uses `#!/usr/bin/env python` to run it.
PiperOrigin-RevId: 401540949
Change-Id: Ic2aefcb5d8168117ade840c91ea1051f0a28a809
|
|
`tensorflow` is calling `absltest.main(argv=argv)` **inside** the main function called by `app.run`: https://github.com/tensorflow/tensorflow/blob/b743f04b1f1b0600ac5bb1c0b8bfc7e33896255a/tensorflow/python/platform/googletest.py#L62-L64
Directly calling `absltest.main(argv=sys.argv)` means to use `sys.argv` for both absl flags parsing AND unittest.main(argv=), which doesn't make much sense.
PiperOrigin-RevId: 400862986
Change-Id: I1af4978d62b9a727bc79e3715b881c78b2e380b9
|
|
PiperOrigin-RevId: 400827557
Change-Id: I09c1a1e183abcf213dacc89169ae9efdbce5945f
|
|
PiperOrigin-RevId: 400032919
Change-Id: I3dc54cac0c98f0d3a64f8471a35f2bfea5cf24bd
|
|
directory after #159 (#160).
PiperOrigin-RevId: 399810236
Change-Id: Ia78c6e27fbcf65c2c9e0de0d1c171c7a172f450a
|
|
PiperOrigin-RevId: 398077931
Change-Id: I8e6633cd3fea910cc31ac2bbe6e4c97a08b25b9b
|
|
PiperOrigin-RevId: 398009906
Change-Id: Idf2432e17a4621a4599371e4e20451f9596530ed
|
|
explicitly pass `argv=` to the `main` function.
This resolves the issue that users of `tf.test.main` can't use bazel to filter tests, as described in https://github.com/abseil/abseil-py/issues/128#issuecomment-921993484
PiperOrigin-RevId: 397883687
Change-Id: Ica703a7c3c67ccca8973340d5812e385e29f1025
|
|
The `FlagHolder` object is returned from `flags.DEFINE_*()` to allow
type-safe and fully-declared access via `myflag.value`, instead of
requiring users to write `FLAGS.myflag`.
Additionally, this proxies the `.default` property from the `Flag`
object underlying the `FlagHolder`, so `FLAGS['myflag'].default` can
instead be written as simply `myflag.default`.
However, the `.present` property is not easily available today without
writing `FLAGS['myflag'].present` or `FLAGS[myflag.name].present`,
despite being relatively commonly used.
Since it intuitively makes sense for this to be available, let's proxy
it through `FlagHolder` to the underlying `Flag` object.
PiperOrigin-RevId: 386901861
Change-Id: I29e3173668080957b796c8634527382b792aa4ec
|
|
This is a required argument for custom argparse.Action classes, and is used when the `ArgumentParse` is created with a `argument_default=`.
PiperOrigin-RevId: 385601086
Change-Id: I01ef4870aa4f0e92f7e8f9be0125c9a0dba16c6f
|