0

I am very new to Python and Behave. In my step file, test_steps.py, I have imported the following:

from behave import given, when, then, step
from behave_http.steps import *
from datetime import datetime
import time
import pdb
import xmltodict
import requests

If I created another step file, test2_steps.py, I had to import above again. Is there a way to avoid that?

Thank you for your help!

Morgan Thrapp
  • 9,748
  • 3
  • 46
  • 67
Claire
  • 23
  • 5

1 Answers1

0

It's generally useful to know all the imports for a given file; however, you can do something like the following:

config.py

from behave import given, when, then, step
from behave_http.steps import *
from datetime import datetime
import time
import pdb
import xmltodict
import requests

test2_steps.py

from config import *
#other code here
Nathan Clement
  • 1,103
  • 2
  • 18
  • 30