Move client constructor to the top level
This allows testing of individual functions using the pytest
name matching functionality, and better decouples the tests.
For example this will run any test containing the string
'recent_search':
pytest -k recent_search
@@ -8,16 +8,13 @@ import threading
dotenv.load_dotenv()
logging.basicConfig(filename="test.log", level=logging.INFO)
-T = None
BEARER_TOKEN = os.environ.get("BEARER_TOKEN")
+T = twarc.Twarc2(bearer_token=BEARER_TOKEN)
+
def test_bearer_token():
assert BEARER_TOKEN
-def test_constructor():
- global T
- T = twarc.Twarc2(bearer_token=BEARER_TOKEN)
-
def test_sample():
count = 0
