aboutsummaryrefslogtreecommitdiff
path: root/absl/tests/app_test.py
diff options
context:
space:
mode:
authorRichard Levasseur <rlevasseur@google.com>2020-04-06 16:49:25 -0700
committerCopybara-Service <copybara-worker@google.com>2020-04-06 16:49:46 -0700
commit2c2a0c3e7fb29fc8bebff2a1753c6c4961f65d0e (patch)
treeb4891ee449ce4a020ec4ceb87aa5f06e0d9b0588 /absl/tests/app_test.py
parente2d3e8fb5042c4fe6f4712faf403db85dc7b7b2a (diff)
downloadabsl-py-2c2a0c3e7fb29fc8bebff2a1753c6c4961f65d0e.tar.gz
Add a test to check that FLAGS is deepcopy-able.
There are some unit tests for deepcopy support, but none that ensure the flags defined by absl behave correctly. PiperOrigin-RevId: 305146969 Change-Id: Ib46316634aac60142a99a5163753e565148818ef
Diffstat (limited to 'absl/tests/app_test.py')
-rw-r--r--absl/tests/app_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/absl/tests/app_test.py b/absl/tests/app_test.py
index d5435d2..9494979 100644
--- a/absl/tests/app_test.py
+++ b/absl/tests/app_test.py
@@ -20,6 +20,7 @@ from __future__ import print_function
import codecs
import contextlib
+import copy
import os
import re
import subprocess
@@ -313,6 +314,14 @@ class FunctionalTests(absltest.TestCase):
self.assertIn('during real_main', stdout)
+class FlagDeepCopyTest(absltest.TestCase):
+ """Make sure absl flags are copy.deepcopy() compatible."""
+
+ def test_deepcopyable(self):
+ copy.deepcopy(FLAGS)
+ # Nothing to assert
+
+
class FlagValuesExternalizationTest(absltest.TestCase):
"""Test to make sure FLAGS can be serialized out and parsed back in."""