Skip to content

Commit

Permalink
chore/docs: remove poetry.lock and other files
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
pstorozenko committed Oct 2, 2024
1 parent c5c502c commit f11650c
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 2,293 deletions.
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# IDE files
.idea
.vscode

# Python files
__pycache__
.ipynb_checkpoints

# MacOS
.DS_Store

# Code coverage
Expand All @@ -9,7 +16,8 @@ lcov.info
# Results of playwright tests with tracing
test-results/

# Files from playwright installed with npm
# Files packages installed with npm (if you use it)
node_modules
package-lock.json
package.json

# Posit Connect deployment
rsconnect-python
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

2,275 changes: 0 additions & 2,275 deletions poetry.lock

This file was deleted.

6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

7 changes: 7 additions & 0 deletions tapyr_template/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@


class AppSettings(BaseSettings):
"""
Placeholder for application settings.
Find more information about pydantic settings
like yaml/toml parameters, environmental variables at:
https://docs.pydantic.dev/latest/concepts/pydantic_settings/
"""

log_level: str = "INFO"
4 changes: 4 additions & 0 deletions tapyr_template/view/root/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
def server(input: Inputs, output: Outputs, session: Session):
@render.ui
def link_button():
"""
UI link that looks like a button. This element could be placed directly in the UI definition
but is here to showcase testing.
"""
return ui.a(
"Start with the docs!",
href="https://appsilon.github.io/tapyr-docs/",
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# conftest.py files are always executed in pytest
# https://stackoverflow.com/questions/34466027/what-is-conftest-py-for-in-pytest

from collections.abc import Generator

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/playwirght/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from shiny.pytest import create_app_fixture

# https://shiny.posit.co/py/docs/end-to-end-testing.html
app = create_app_fixture("../../app.py")
9 changes: 7 additions & 2 deletions tests/playwirght/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
from shiny.run import ShinyAppProc


def test_startup2(page: Page, app: ShinyAppProc):
def test_startup(page: Page, app: ShinyAppProc):
"""
Tests if shiny apps has successfully started.
"""
page.goto(app.url)

# Wait for the page to load fully
page.wait_for_load_state("networkidle")

# Check if the `#shiny-disconnected-overlay` element is not present
# When shiny fails after startup, it adds the #shiny-disconnected-overlay div
# We check if it's not present in the page
assert not page.query_selector("#shiny-disconnected-overlay"), "The shiny app failed to start"


Expand All @@ -20,5 +24,6 @@ def test_link_button(page: Page, app: ShinyAppProc):
And probably you want to remove/adjust for your own needs.
"""
page.goto(app.url)
# https://shiny.posit.co/py/docs/end-to-end-testing.html
link_button = controller.OutputUi(page, "link_button")
link_button.expect.to_contain_text("Start with the docs!")

0 comments on commit f11650c

Please sign in to comment.