]> git.puffer.fish Git - matthieu/frr.git/commitdiff
example: add missing __init__.py
authorRafael Zalamena <rzalamena@gmail.com>
Thu, 22 Jun 2017 20:01:58 +0000 (17:01 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:11 +0000 (20:22 -0500)
Adding the __init__.py file makes python and its linter recognize that
the test makes part of the package, this makes us save a few lines of
code to make the linter and auto complete engines happy.

tests/topotests/example-test/__init__.py [new file with mode: 0644]
tests/topotests/example-test/test_template.py

diff --git a/tests/topotests/example-test/__init__.py b/tests/topotests/example-test/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 53a4f444cc5bf655296bdb3a8980123d28f26b80..d5d3b7afb39aa1e85fe7b075a0810cc91ebfadab 100644 (file)
@@ -30,25 +30,20 @@ import os
 import sys
 import pytest
 
+# Import topogen and topotest helpers
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+
 # Required to instantiate the topology builder class.
 from mininet.topo import Topo
 
 # Save the Current Working Directory to find configuration files.
 CWD = os.path.dirname(os.path.realpath(__file__))
-# Append to the search path the lib location
-sys.path.append(os.path.join(CWD, '..'))
-
-# pylint: disable=C0413
-# Import topogen and topotest helpers
-from lib import topotest
-from lib.topogen import Topogen, TopoRouter, get_topogen
 
 class TemplateTopo(Topo):
     "Test topology builder"
     def build(self, *_args, **_opts):
         "Build function"
-        # pylint: disable=E1101
-        # Linter incorrectly detects tgen type as TemplateTopo.
         tgen = get_topogen(self)
 
         # This function only purpose is to define allocation and relationship