diff options
author | Xiaofei Wang <wangxf@google.com> | 2018-04-11 20:19:11 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-11 20:19:22 -0700 |
commit | f2661a52cf27bcaf8aff6dbefe0e0dde36af5591 (patch) | |
tree | 2420e1a27957f1e9729a81961f45ac3e58409781 | |
parent | 9187b09be338dd83ef327cf9ab71b3571c84cf01 (diff) | |
download | absl-py-f2661a52cf27bcaf8aff6dbefe0e0dde36af5591.tar.gz |
Fix the package structure so that setuptools.find_packages can find unittest3_backport.
Also add a smoke test to cover absltest.
PiperOrigin-RevId: 192550825
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | absl/third_party/__init__.py | 0 | ||||
-rw-r--r-- | smoke_tests/sample_app.py (renamed from smoke_tests/smoke_test.py) | 0 | ||||
-rw-r--r-- | smoke_tests/sample_test.py | 33 | ||||
-rwxr-xr-x | smoke_tests/smoke_test.sh | 3 |
5 files changed, 36 insertions, 2 deletions
@@ -40,7 +40,7 @@ bazel test absl/... ### Example Code -Please refer to [smoke_tests/smoke_test.py](smoke_tests/smoke_test.py) as an +Please refer to [smoke_tests/sample_app.py](smoke_tests/sample_app.py) as an example to get started. ## Documentation diff --git a/absl/third_party/__init__.py b/absl/third_party/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/absl/third_party/__init__.py diff --git a/smoke_tests/smoke_test.py b/smoke_tests/sample_app.py index 532a11e..532a11e 100644 --- a/smoke_tests/smoke_test.py +++ b/smoke_tests/sample_app.py diff --git a/smoke_tests/sample_test.py b/smoke_tests/sample_test.py new file mode 100644 index 0000000..713677a --- /dev/null +++ b/smoke_tests/sample_test.py @@ -0,0 +1,33 @@ +# Copyright 2018 The Abseil Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Test helper for smoke_test.sh.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +from absl.testing import absltest + + +class SampleTest(absltest.TestCase): + + def test_subtest(self): + for i in (1, 2): + with self.subTest(i=i): + self.assertEqual(i, i) + print('msg_for_test') + +if __name__ == '__main__': + absltest.main() diff --git a/smoke_tests/smoke_test.sh b/smoke_tests/smoke_test.sh index ada2e34..9754fa3 100755 --- a/smoke_tests/smoke_test.sh +++ b/smoke_tests/smoke_test.sh @@ -52,4 +52,5 @@ pip --version pip install six python setup.py install -python smoke_tests/smoke_test.py --echo smoke 2>&1 |grep 'echo is smoke.' +python smoke_tests/sample_app.py --echo smoke 2>&1 |grep 'echo is smoke.' +python smoke_tests/sample_test.py 2>&1 | grep 'msg_for_test' |