From 885b60f31f5a87ff28882f0d5f7dd5e8f115db8f Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 13 Nov 2014 10:32:38 -0800 Subject: [PATCH] if __name__ does work with ansible modules --- packaging/os/apt.py | 3 +-- tests/test_apt.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packaging/os/apt.py b/packaging/os/apt.py index 459aaaa97a9..d732619b94e 100644 --- a/packaging/os/apt.py +++ b/packaging/os/apt.py @@ -568,6 +568,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * -# FIXME: if __name__ == "__main__": ? -if "ANSIBLE_IN_HAPPY_UNITTEST_LAND" not in os.environ: +if __name__ == "__main__": main() diff --git a/tests/test_apt.py b/tests/test_apt.py index 10e3583801f..c5802227759 100644 --- a/tests/test_apt.py +++ b/tests/test_apt.py @@ -3,8 +3,6 @@ import mock import os import unittest -# FIXME: this is not super elegant -os.environ["ANSIBLE_IN_HAPPY_UNITTEST_LAND"] = "1" from packaging.apt import ( expand_pkgspec_from_fnmatches, )