Best Python code snippet using pandera_python
noxfile.py
Source: noxfile.py
...10BUILD = None11def default(session):12 DEFAULTS.append(session.__name__)13 return session14def install_from_requirements(session, filename):15 session.install("-r", f"requirements/{filename}.txt")16def _build(session):17 global BUILD18 if BUILD is None:19 install_from_requirements(session, "wheel")20 session.run("python", "setup.py", "bdist_wheel")21 version = session.run("python", "setup.py", "--version", silent=True).strip()22 for filename in os.listdir("dist"):23 if filename.endswith(".whl") and f"-{version}-" in filename:24 BUILD = os.path.join("dist", filename)25 break26@default27@nox.session28def clean(session):29 install_from_requirements(session, "coverage")30 session.run("coverage", "erase")31@default32@nox.session33def check(session):34 install_from_requirements(session, "check")35 session.run("python", "setup.py", "sdist")36 session.run("python", "setup.py", "bdist_wheel")37 session.run("twine", "check", "dist/*")38 session.run("check-manifest", ".")39 session.run("flake8", "src", "tests", "setup.py")40 session.run(41 "isort",42 "--verbose",43 "--check-only",44 "--diff",45 "--recursive",46 "src",47 "tests",48 "setup.py",49 )50@default51@nox.session52def mypy(session):53 install_from_requirements(session, "mypy")54 session.run("mypy", "src/structured_data")55@default56@nox.session57def build(session):58 _build(session)59@default60@nox.session(python=VERSIONS)61def nocov(session):62 _build(session)63 session.install("--upgrade", BUILD)64 install_from_requirements(session, "pytest")65 session.run("pytest", "-vv")66@default67@nox.session(python=VERSIONS)68def cover(session):69 _build(session)70 session.install("--upgrade", BUILD)71 install_from_requirements(session, "cover")72 session.run("coverage", "run", "--append", "-m", "pytest", "-vv")73@default74@nox.session75def report(session):76 install_from_requirements(session, "report")77 session.run("limit-coverage")78 session.run("coverage", "html", "--show-contexts")79 session.run("coverage", "report", "--skip-covered", "-m", "--fail-under=100")80@default81@nox.session82def docs(session):83 session.install("-r", "docs/requirements.txt")84 session.run("sphinx-build", "-E", "-b", "html", "docs", "dist-docs")85 session.run("sphinx-build", "-b", "linkcheck", "docs", "dist-docs")86@nox.session87def mutmut_install(session):88 install_from_requirements(session, "mutmut_install")89 session.install("-e", ".")90@nox.session91def coveralls(session):92 install_from_requirements(session, "coveralls")93 session.run("coveralls", "[]")94@nox.session95def codecov(session):96 install_from_requirements(session, "codecov")97 session.run("coverage", "xml", "--ignore-errors")98 session.run("codecov", "-f", "coverage.xml")99@nox.session(python=False)100def bootstrap(session):101 del session # Unused102 jinja = jinja2.Environment(103 loader=jinja2.FileSystemLoader(os.path.join("ci", "templates")),104 trim_blocks=True,105 lstrip_blocks=True,106 keep_trailing_newline=True,107 )108 nox_environments = {}109 for (alias, conf) in matrix.from_file("setup.cfg").items():110 python = conf["python_versions"]...
rvenv.py
Source: rvenv.py
...12 with self.activate():13 self.runner('pip install -U pip', pty=False)14 for d in self.dependencies:15 if d[-4:] == '.txt':16 self.install_from_requirements(d)17 elif d[0] == '!':18 # Custom command after exclamation mark19 self.runner(d[1:])20 else:21 # Python package22 self.runner('pip install -U {}'.format(d), pty=False)23 def init(self):24 if not self.exists():25 self.runner('python3 -m venv {}'.format(self.envpath))26 @contextmanager27 def activate(self):28 raise NotImplementedError29class RemoteVirtualEnv(VirtualEnv):30 def __init__(self, envpath, dependencies=()):31 super(RemoteVirtualEnv, self).__init__(envpath, dependencies)32 self.runner = run33 def exists(self):34 return exists(self.envpath)35 def install_from_requirements(self, reqfile='requirements.txt'):36 with requirements_file(reqfile) as fname:37 self.runner('pip install -r {}'.format(fname), pty=False)38 @contextmanager39 def activate(self):40 activate = posixpath.join(self.envpath, 'bin/activate')41 if not exists(activate):42 raise OSError('Cannot activate virtualenv {}'.format(self.envpath))43 with prefix('. {}'.format(activate)):44 yield45@contextmanager46def requirements_file(fname):47 if exists(fname):48 yield fname49 else:...
Check out the latest blogs from LambdaTest on this topic:
I routinely come across test strategy documents when working with customers. They are lengthy—100 pages or more—and packed with monotonous text that is routinely reused from one project to another. Yawn once more— the test halt and resume circumstances, the defect management procedure, entrance and exit criteria, unnecessary generic risks, and in fact, one often-used model replicates the requirements of textbook testing, from stress to systems integration.
When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.
Pair testing can help you complete your testing tasks faster and with higher quality. But who can do pair testing, and when should it be done? And what form of pair testing is best for your circumstance? Check out this blog for more information on how to conduct pair testing to optimize its benefits.
People love to watch, read and interact with quality content — especially video content. Whether it is sports, news, TV shows, or videos captured on smartphones, people crave digital content. The emergence of OTT platforms has already shaped the way people consume content. Viewers can now enjoy their favorite shows whenever they want rather than at pre-set times. Thus, the OTT platform’s concept of viewing anything, anytime, anywhere has hit the right chord.
Have you ever visited a website that only has plain text and images? Most probably, no. It’s because such websites do not exist now. But there was a time when websites only had plain text and images with almost no styling. For the longest time, websites did not focus on user experience. For instance, this is how eBay’s homepage looked in 1999.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!