File: conftest.py

package info (click to toggle)
librouteros 3.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 376 kB
  • sloc: python: 1,579; makefile: 141; sh: 4
file content (16 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest
from subprocess import check_output
import sys


@pytest.fixture
def installed_packages():
    pkgs = []
    pip_executable = [sys.executable, "-m", "pip"]
    result = check_output(pip_executable + ["freeze", "--local", "--all"])
    for line in result.decode().splitlines():
        if "==" in line:
            pkg, version = line.split("==", 1)
            pkgs.append(pkg)

    return pkgs