Skip to content

Commit

Permalink
🐛 fix issue #2
Browse files Browse the repository at this point in the history
Ignore targets which missing name or name is empty.

Close #2
  • Loading branch information
luizyao committed Aug 19, 2020
1 parent ad29720 commit 4537d16
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pytest_pyppeteer/plugin.py
@@ -1,15 +1,15 @@
import asyncio
import inspect
from typing import Any, Dict, List, Optional, Tuple, Union
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union

import pytest
import toml
from _pytest import config as conf
from _pytest.config import Config
from _pytest.fixtures import SubRequest
from _pytest.nodes import Item
from _pytest.main import Session
from _pytest.config import Config
from _pytest.nodes import Item
from pydantic import root_validator, FilePath

from .models import Page, Pyppeteer, PyppeteerOptions, PyppeteerSettings
Expand Down Expand Up @@ -127,7 +127,9 @@ def homepage_must_exist(cls, values: Dict[str, Any]) -> Dict[str, Any]:
return values

targets_settings: Dict = settings.get("targets", {})
targets = {k: Target.parse_obj(v) for k, v in targets_settings.items()}
targets = {
k: Target.parse_obj(v) for k, v in targets_settings.items() if v.get("name", "")
}
return targets


Expand Down

0 comments on commit 4537d16

Please sign in to comment.