Skip to content

Commit

Permalink
fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
dmy.berezovskyi committed Oct 8, 2024
1 parent a2b4965 commit 3396679
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use an official Python image compatible with arm64 architecture
FROM --platform=linux/arm64 python:3.12-slim

# Set environment variables
ENV POETRY_VERSION=1.8.1
ENV PATH="/root/.local/bin:$PATH"
ENV PYTHONPATH="pytest-python-selenium-framework"

# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

# Set the working directory
WORKDIR pytest-python-selenium-framework

# Copy the poetry files to the container
COPY pyproject.toml poetry.lock* ./

# Install the dependencies using Poetry
RUN poetry install --no-root --only main # Use --only main to skip dev dependencies

# Copy the rest of the application code
COPY . .

# Specify the command to run the tests
CMD ["poetry", "run", "pytest"]
Empty file added src/pageobjects/__init__.py
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion tests/test_fill_form/test_fill_form.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pageobjects.text.fill_form import FillForm
from src.pageobjects.text.fill_form import FillForm

Check failure on line 1 in tests/test_fill_form/test_fill_form.py

View workflow job for this annotation

GitHub Actions / JUnit Test Report

tests/test_fill_form/test_fill_form.py.tests.test_fill_form.test_fill_form

collection failure
Raw output
ImportError while importing test module '/Users/runner/work/pytest-python-selenium-framework/pytest-python-selenium-framework/tests/test_fill_form/test_fill_form.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../Library/Caches/pypoetry/virtualenvs/simple-framework-AWMYOlGi-py3.12/lib/python3.12/site-packages/_pytest/python.py:493: in importtestmodule
    mod = import_path(
../../../Library/Caches/pypoetry/virtualenvs/simple-framework-AWMYOlGi-py3.12/lib/python3.12/site-packages/_pytest/pathlib.py:582: in import_path
    importlib.import_module(module_name)
/opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
../../../Library/Caches/pypoetry/virtualenvs/simple-framework-AWMYOlGi-py3.12/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:174: in exec_module
    exec(co, module.__dict__)
tests/test_fill_form/test_fill_form.py:1: in <module>
    from src.pageobjects.text.fill_form import FillForm
../../../Library/Caches/pypoetry/virtualenvs/simple-framework-AWMYOlGi-py3.12/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:174: in exec_module
    exec(co, module.__dict__)
src/pageobjects/text/fill_form.py:1: in <module>
    from locators.locators import TextFields
E   ModuleNotFoundError: No module named 'locators'


class TestFillForm:
Expand Down

0 comments on commit 3396679

Please sign in to comment.