text:
import os
import platform
from datetime import datetime
from typing import cast
from typing import List
from typing import Tuple
from xml.dom import minidom

import py
import xmlschema

import pytest
from _pytest.compat import TYPE_CHECKING
from _pytest.config import Config
from _pytest.junitxml import bin_xml_escape
from _pytest.junitxml import LogXML
from _pytest.pathlib import Path
from _pytest.reports import BaseReport
from _pytest.reports import TestReport
from _pytest.store import Store

@pytest.fixture(scope="session")
def schema():
    """Return an xmlschema.XMLSchema object for the junit-10.xsd file."""
    fn = Path(__file__).parent / "example_scripts/junit-10.xsd"
    with fn.open() as f:
        return xmlschema.XMLSchema(f)

@pytest.fixture
def run_and_parse(testdir, schema):
    """Fixture that returns a function that can be used to execute pytest and
    return the parsed ``DomNode`` of the root xml node.

    The ``family`` parameter is used to configure the ``junit_family`` of the written report.
    "xunit2" is also automatically validated against the schema.
    """

    def run(*args, family="xunit1"):
        if family:
            args = ("-o", "junit_family=" + family) + args
        xml_path = testdir.tmpdir.join("junit.xml")
        result = testdir.runpytest("--junitxml=%s" % xml_path, *args)
        if family == "xunit2":
            with xml_path.open() as f:
                schema.validate(f)
        xmldoc = minidom.parse(str(xml_path))
        return result, DomNode(xmldoc)

    return run

def assert_attr(node, **kwargs):
    __tracebackhide__ = True

    def nodeval(node, name):
        anode = node.getAttributeNode(name)
        if anode is not None:
            return anode.value

    expected = {name: str(value) for name, value in kwargs.items()}
    on_node = {name: nodeval(node, name) for name in expected}
    assert on_node == expected

class DomNode:
    def __init__(self, dom):
        self.__node = dom

    def __repr__(self):
        return self.__node.toxml()

    def find_first_by_tag(self, tag):
        return self.find_nth_by_tag(tag, 0)

    def _by_tag(self, tag):
        return self.__node.getElementsByTagName(tag)

    @property
    def children(self):
        return [type(self)(x) for x in self.__node.childNodes]

    @property
    def get_unique_child(self):
        children = self.children
        assert len(children) == 1
        return children[0]

    def find_nth_by_tag(self, tag, n):
        items = self._by_tag(tag)
        try:
            nth = items[n]
        except IndexError:
            pass
        else:
            return type(self)(nth)

    def find_by_tag(self, tag):
        t = type(self)
        return [t(x) for x in self.__node.getElementsByTagName(tag)]

    def __getitem__(self, key):
        node = self.__node.getAttributeNode(key)
        if node is not None:
            return node.value

    def assert_attr(self, **kwargs):
        __tracebackhide__ = True
        return assert_attr(self.__node, **kwargs)

    def toxml(self):
        return self.__node.toxml()

    @property
    def text(self):
        return self.__node.childNodes[0].wholeText

    @property
    def tag(self):
        return self.__node.tagName

    @property
    def next_sibling(self):
        return type(self)(self.__node.nextSibling)

parametrize_families = pytest.mark.parametrize("xunit_family", ["xunit1", "xunit2"])

class TestPython:
    @parametrize_families
    def test_summing_simple(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            def test_pass():
                pass
            def test_fail():
                assert 0
            def test_skip():
                pytest.skip("")
            @pytest.mark.xfail
            def test_xfail():
                assert 0
            @pytest.mark.xfail
            def test_xpass():
                assert 1
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(name="pytest", errors=0, failures=1, skipped=2, tests=5)

    @parametrize_families
    def test_summing_simple_with_errors(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.fixture
            def fixture():
                raise Exception()
            def test_pass():
                pass
            def test_fail():
                assert 0
            def test_error(fixture):
                pass
            @pytest.mark.xfail
            def test_xfail():
                assert False
            @pytest.mark.xfail(strict=True)
            def test_xpass():
                assert True
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(name="pytest", errors=1, failures=2, skipped=1, tests=5)

    @parametrize_families
    def test_hostname_in_xml(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            def test_pass():
                pass
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(hostname=platform.node())

    @parametrize_families
    def test_timestamp_in_xml(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            def test_pass():
                pass
        """
        )
        start_time = datetime.now()
        result, dom = run_and_parse(family=xunit_family)
        node = dom.find_first_by_tag("testsuite")
        timestamp = datetime.strptime(node["timestamp"], "%Y-%m-%dT%H:%M:%S.%f")
        assert start_time <= timestamp < datetime.now()

    def test_timing_function(self, testdir, run_and_parse, mock_timing):
        testdir.makepyfile(
            """
            from _pytest import timing
            def setup_module():
                timing.sleep(1)
            def teardown_module():
                timing.sleep(2)
            def test_sleep():
                timing.sleep(4)
        """
        )
        result, dom = run_and_parse()
        node = dom.find_first_by_tag("testsuite")
        tnode = node.find_first_by_tag("testcase")
        val = tnode["time"]
        assert float(val) == 7.0

    @pytest.mark.parametrize("duration_report", ["call", "total"])
    def test_junit_duration_report(
        self, testdir, monkeypatch, duration_report, run_and_parse
    ):

        # mock LogXML.node_reporter so it always sets a known duration to each test report object
        original_node_reporter = LogXML.node_reporter

        def node_reporter_wrapper(s, report):
            report.duration = 1.0
            reporter = original_node_reporter(s, report)
            return reporter

        monkeypatch.setattr(LogXML, "node_reporter", node_reporter_wrapper)

        testdir.makepyfile(
            """
            def test_foo():
                pass
        """
        )
        result, dom = run_and_parse(
            "-o", "junit_duration_report={}".format(duration_report)
        )
        node = dom.find_first_by_tag("testsuite")
        tnode = node.find_first_by_tag("testcase")
        val = float(tnode["time"])
        if duration_report == "total":
            assert val == 3.0
        else:
            assert duration_report == "call"
            assert val == 1.0

    @parametrize_families
    def test_setup_error(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest

            @pytest.fixture
            def arg(request):
                raise ValueError("Error reason")
            def test_function(arg):
                pass
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(errors=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_setup_error", name="test_function")
        fnode = tnode.find_first_by_tag("error")
        fnode.assert_attr(message='failed on setup with "ValueError: Error reason"')
        assert "ValueError" in fnode.toxml()

    @parametrize_families
    def test_teardown_error(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest

            @pytest.fixture
            def arg():
                yield
                raise ValueError('Error reason')
            def test_function(arg):
                pass
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_teardown_error", name="test_function")
        fnode = tnode.find_first_by_tag("error")
        fnode.assert_attr(message='failed on teardown with "ValueError: Error reason"')
        assert "ValueError" in fnode.toxml()

    @parametrize_families
    def test_call_failure_teardown_error(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest

            @pytest.fixture
            def arg():
                yield
                raise Exception("Teardown Exception")
            def test_function(arg):
                raise Exception("Call Exception")
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(errors=1, failures=1, tests=1)
        first, second = dom.find_by_tag("testcase")
        assert first
        assert second
        assert first != second
        fnode = first.find_first_by_tag("failure")
        fnode.assert_attr(message="Exception: Call Exception")
        snode = second.find_first_by_tag("error")
        snode.assert_attr(
            message='failed on teardown with "Exception: Teardown Exception"'
        )

    @parametrize_families
    def test_skip_contains_name_reason(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            def test_skip():
                pytest.skip("hello23")
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret == 0
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_skip_contains_name_reason", name="test_skip")
        snode = tnode.find_first_by_tag("skipped")
        snode.assert_attr(type="pytest.skip", message="hello23")

    @parametrize_families
    def test_mark_skip_contains_name_reason(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.skip(reason="hello24")
            def test_skip():
                assert True
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret == 0
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(
            classname="test_mark_skip_contains_name_reason", name="test_skip"
        )
        snode = tnode.find_first_by_tag("skipped")
        snode.assert_attr(type="pytest.skip", message="hello24")

    @parametrize_families
    def test_mark_skipif_contains_name_reason(
        self, testdir, run_and_parse, xunit_family
    ):
        testdir.makepyfile(
            """
            import pytest
            GLOBAL_CONDITION = True
            @pytest.mark.skipif(GLOBAL_CONDITION, reason="hello25")
            def test_skip():
                assert True
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret == 0
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(
            classname="test_mark_skipif_contains_name_reason", name="test_skip"
        )
        snode = tnode.find_first_by_tag("skipped")
        snode.assert_attr(type="pytest.skip", message="hello25")

    @parametrize_families
    def test_mark_skip_doesnt_capture_output(
        self, testdir, run_and_parse, xunit_family
    ):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.skip(reason="foo")
            def test_skip():
                print("bar!")
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret == 0
        node_xml = dom.find_first_by_tag("testsuite").toxml()
        assert "bar!" not in node_xml

    @parametrize_families
    def test_classname_instance(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            class TestClass(object):
                def test_method(self):
                    assert 0
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(failures=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(
            classname="test_classname_instance.TestClass", name="test_method"
        )

    @parametrize_families
    def test_classname_nested_dir(self, testdir, run_and_parse, xunit_family):
        p = testdir.tmpdir.ensure("sub", "test_hello.py")
        p.write("def test_func(): 0/0")
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(failures=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="sub.test_hello", name="test_func")

    @parametrize_families
    def test_internal_error(self, testdir, run_and_parse, xunit_family):
        testdir.makeconftest("def pytest_runtest_protocol(): 0 / 0")
        testdir.makepyfile("def test_function(): pass")
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(errors=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="pytest", name="internal")
        fnode = tnode.find_first_by_tag("error")
        fnode.assert_attr(message="internal error")
        assert "Division" in fnode.toxml()

    @pytest.mark.parametrize(
        "junit_logging", ["no", "log", "system-out", "system-err", "out-err", "all"]
    )
    @parametrize_families
    def test_failure_function(
        self, testdir, junit_logging, run_and_parse, xunit_family
    ):
        testdir.makepyfile(
            """
            import logging
            import sys

            def test_fail():
                print("hello-stdout")
                sys.stderr.write("hello-stderr\\n")
                logging.info('info msg')
                logging.warning('warning msg')
                raise ValueError(42)
        """
        )

        result, dom = run_and_parse(
            "-o", "junit_logging=%s" % junit_logging, family=xunit_family
        )
        assert result.ret, "Expected ret > 0"
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(failures=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_failure_function", name="test_fail")
        fnode = tnode.find_first_by_tag("failure")
        fnode.assert_attr(message="ValueError: 42")
        assert "ValueError" in fnode.toxml(), "ValueError not included"

        if junit_logging in ["log", "all"]:
            logdata = tnode.find_first_by_tag("system-out")
            log_xml = logdata.toxml()
            assert logdata.tag == "system-out", "Expected tag: system-out"
            assert "info msg" not in log_xml, "Unexpected INFO message"
            assert "warning msg" in log_xml, "Missing WARN message"
        if junit_logging in ["system-out", "out-err", "all"]:
            systemout = tnode.find_first_by_tag("system-out")
            systemout_xml = systemout.toxml()
            assert systemout.tag == "system-out", "Expected tag: system-out"
            assert "info msg" not in systemout_xml, "INFO message found in system-out"
            assert (
                "hello-stdout" in systemout_xml
            ), "Missing 'hello-stdout' in system-out"
        if junit_logging in ["system-err", "out-err", "all"]:
            systemerr = tnode.find_first_by_tag("system-err")
            systemerr_xml = systemerr.toxml()
            assert systemerr.tag == "system-err", "Expected tag: system-err"
            assert "info msg" not in systemerr_xml, "INFO message found in system-err"
            assert (
                "hello-stderr" in systemerr_xml
            ), "Missing 'hello-stderr' in system-err"
            assert (
                "warning msg" not in systemerr_xml
            ), "WARN message found in system-err"
        if junit_logging == "no":
            assert not tnode.find_by_tag("log"), "Found unexpected content: log"
            assert not tnode.find_by_tag(
                "system-out"
            ), "Found unexpected content: system-out"
            assert not tnode.find_by_tag(
                "system-err"
            ), "Found unexpected content: system-err"

    @parametrize_families
    def test_failure_verbose_message(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import sys
            def test_fail():
                assert 0, "An error"
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        node = dom.find_first_by_tag("testsuite")
        tnode = node.find_first_by_tag("testcase")
        fnode = tnode.find_first_by_tag("failure")
        fnode.assert_attr(message="AssertionError: An error\nassert 0")

    @parametrize_families
    def test_failure_escape(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.parametrize('arg1', "<&'", ids="<&'")
            def test_func(arg1):
                print(arg1)
                assert 0
        """
        )
        result, dom = run_and_parse(
            "-o", "junit_logging=system-out", family=xunit_family
        )
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(failures=3, tests=3)

        for index, char in enumerate("<&'"):

            tnode = node.find_nth_by_tag("testcase", index)
            tnode.assert_attr(
                classname="test_failure_escape", name="test_func[%s]" % char
            )
            sysout = tnode.find_first_by_tag("system-out")
            text = sysout.text
            assert "%s\n" % char in text

    @parametrize_families
    def test_junit_prefixing(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            def test_func():
                assert 0
            class TestHello(object):
                def test_hello(self):
                    pass
        """
        )
        result, dom = run_and_parse("--junitprefix=xyz", family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(failures=1, tests=2)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="xyz.test_junit_prefixing", name="test_func")
        tnode = node.find_nth_by_tag("testcase", 1)
        tnode.assert_attr(
            classname="xyz.test_junit_prefixing.TestHello", name="test_hello"
        )

    @parametrize_families
    def test_xfailure_function(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            def test_xfail():
                pytest.xfail("42")
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert not result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_xfailure_function", name="test_xfail")
        fnode = tnode.find_first_by_tag("skipped")
        fnode.assert_attr(type="pytest.xfail", message="42")

    @parametrize_families
    def test_xfailure_marker(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.xfail(reason="42")
            def test_xfail():
                assert False
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        assert not result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_xfailure_marker", name="test_xfail")
        fnode = tnode.find_first_by_tag("skipped")
        fnode.assert_attr(type="pytest.xfail", message="42")

    @pytest.mark.parametrize(
        "junit_logging", ["no", "log", "system-out", "system-err", "out-err", "all"]
    )
    def test_xfail_captures_output_once(self, testdir, junit_logging, run_and_parse):
        testdir.makepyfile(
            """
            import sys
            import pytest

            @pytest.mark.xfail()
            def test_fail():
                sys.stdout.write('XFAIL This is stdout')
                sys.stderr.write('XFAIL This is stderr')
                assert 0
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        tnode = node.find_first_by_tag("testcase")
        if junit_logging in ["system-err", "out-err", "all"]:
            assert len(tnode.find_by_tag("system-err")) == 1
        else:
            assert len(tnode.find_by_tag("system-err")) == 0

        if junit_logging in ["log", "system-out", "out-err", "all"]:
            assert len(tnode.find_by_tag("system-out")) == 1
        else:
            assert len(tnode.find_by_tag("system-out")) == 0

    @parametrize_families
    def test_xfailure_xpass(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.xfail
            def test_xpass():
                pass
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        # assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=0, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_xfailure_xpass", name="test_xpass")

    @parametrize_families
    def test_xfailure_xpass_strict(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile(
            """
            import pytest
            @pytest.mark.xfail(strict=True, reason="This needs to fail!")
            def test_xpass():
                pass
        """
        )
        result, dom = run_and_parse(family=xunit_family)
        # assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(skipped=0, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(classname="test_xfailure_xpass_strict", name="test_xpass")
        fnode = tnode.find_first_by_tag("failure")
        fnode.assert_attr(message="[XPASS(strict)] This needs to fail!")

    @parametrize_families
    def test_collect_error(self, testdir, run_and_parse, xunit_family):
        testdir.makepyfile("syntax error")
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(errors=1, tests=1)
        tnode = node.find_first_by_tag("testcase")
        fnode = tnode.find_first_by_tag("error")
        fnode.assert_attr(message="collection failure")
        assert "SyntaxError" in fnode.toxml()

    def test_unicode(self, testdir, run_and_parse):
        value = "hx\xc4\x85\xc4\x87\n"
        testdir.makepyfile(
            """\
            # coding: latin1
            def test_hello():
                print(%r)
                assert 0
            """
            % value
        )
        result, dom = run_and_parse()
        assert result.ret == 1
        tnode = dom.find_first_by_tag("testcase")
        fnode = tnode.find_first_by_tag("failure")
        assert "hx" in fnode.toxml()

    def test_assertion_binchars(self, testdir, run_and_parse):
        """This test did fail when the escaping wasn't strict."""
        testdir.makepyfile(
            """

            M1 = '\x01\x02\x03\x04'
            M2 = '\x01\x02\x03\x05'

            def test_str_compare():
                assert M1 == M2
            """
        )
        result, dom = run_and_parse()
        print(dom.toxml())

    @pytest.mark.parametrize("junit_logging", ["no", "system-out"])
    def test_pass_captures_stdout(self, testdir, run_and_parse, junit_logging):
        testdir.makepyfile(
            """
            def test_pass():
                print('hello-stdout')
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        pnode = node.find_first_by_tag("testcase")
        if junit_logging == "no":
            assert not node.find_by_tag(
                "system-out"
            ), "system-out should not be generated"
        if junit_logging == "system-out":
            systemout = pnode.find_first_by_tag("system-out")
            assert (
                "hello-stdout" in systemout.toxml()
            ), "'hello-stdout' should be in system-out"

    @pytest.mark.parametrize("junit_logging", ["no", "system-err"])
    def test_pass_captures_stderr(self, testdir, run_and_parse, junit_logging):
        testdir.makepyfile(
            """
            import sys
            def test_pass():
                sys.stderr.write('hello-stderr')
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        pnode = node.find_first_by_tag("testcase")
        if junit_logging == "no":
            assert not node.find_by_tag(
                "system-err"
            ), "system-err should not be generated"
        if junit_logging == "system-err":
            systemerr = pnode.find_first_by_tag("system-err")
            assert (
                "hello-stderr" in systemerr.toxml()
            ), "'hello-stderr' should be in system-err"

    @pytest.mark.parametrize("junit_logging", ["no", "system-out"])
    def test_setup_error_captures_stdout(self, testdir, run_and_parse, junit_logging):
        testdir.makepyfile(
            """
            import pytest

            @pytest.fixture
            def arg(request):
                print('hello-stdout')
                raise ValueError()
            def test_function(arg):
                pass
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        pnode = node.find_first_by_tag("testcase")
        if junit_logging == "no":
            assert not node.find_by_tag(
                "system-out"
            ), "system-out should not be generated"
        if junit_logging == "system-out":
            systemout = pnode.find_first_by_tag("system-out")
            assert (
                "hello-stdout" in systemout.toxml()
            ), "'hello-stdout' should be in system-out"

    @pytest.mark.parametrize("junit_logging", ["no", "system-err"])
    def test_setup_error_captures_stderr(self, testdir, run_and_parse, junit_logging):
        testdir.makepyfile(
            """
            import sys
            import pytest

            @pytest.fixture
            def arg(request):
                sys.stderr.write('hello-stderr')
                raise ValueError()
            def test_function(arg):
                pass
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        pnode = node.find_first_by_tag("testcase")
        if junit_logging == "no":
            assert not node.find_by_tag(
                "system-err"
            ), "system-err should not be generated"
        if junit_logging == "system-err":
            systemerr = pnode.find_first_by_tag("system-err")
            assert (
                "hello-stderr" in systemerr.toxml()
            ), "'hello-stderr' should be in system-err"

    @pytest.mark.parametrize("junit_logging", ["no", "system-out"])
    def test_avoid_double_stdout(self, testdir, run_and_parse, junit_logging):
        testdir.makepyfile(
            """
            import sys
            import pytest

            @pytest.fixture
            def arg(request):
                yield
                sys.stdout.write('hello-stdout teardown')
                raise ValueError()
            def test_function(arg):
                sys.stdout.write('hello-stdout call')
        """
        )
        result, dom = run_and_parse("-o", "junit_logging=%s" % junit_logging)
        node = dom.find_first_by_tag("testsuite")
        pnode = node.find_first_by_tag("testcase")
        if junit_logging == "no":
            assert not node.find_by_tag(
                "system-out"
            ), "system-out should not be generated"
        if junit_logging == "system-out":
            systemout = pnode.find_first_by_tag("system-out")
            assert "hello-stdout call" in systemout.toxml()
            assert "hello-stdout teardown" in systemout.toxml()

def test_mangle_test_address():
    from _pytest.junitxml import mangle_test_address

    address = "::".join(["a/my.py.thing.py", "Class", "()", "method", "[a-1-::]"])
    newnames = mangle_test_address(address)
    assert newnames == ["a.my.py.thing", "Class", "method", "[a-1-::]"]

def test_dont_configure_on_workers(tmpdir) -> None:
    gotten = []  # type: List[object]

    class FakeConfig:
        if TYPE_CHECKING:
            workerinput = None

        def __init__(self):
            self.pluginmanager = self
            self.option = self
            self._store = Store()

        def getini(self, name):
            return "pytest"

        junitprefix = None
        # XXX: shouldn't need tmpdir ?
        xmlpath = str(tmpdir.join("junix.xml"))
        register = gotten.append

    fake_config = cast(Config, FakeConfig())
    from _pytest import junitxml

    junitxml.pytest_configure(fake_config)
    assert len(gotten) == 1
    FakeConfig.workerinput = None
    junitxml.pytest_configure(fake_config)
    assert len(gotten) == 1

class TestNonPython:
    @parametrize_families
    def test_summing_simple(self, testdir, run_and_parse, xunit_family):
        testdir.makeconftest(
            """
            import pytest
            def pytest_collect_file(path, parent):
                if path.ext == ".xyz":
                    return MyItem.from_parent(name=path.basename, parent=parent)
            class MyItem(pytest.Item):
                def runtest(self):
                    raise ValueError(42)
                def repr_failure(self, excinfo):
                    return "custom item runtest failed"
        """
        )
        testdir.tmpdir.join("myfile.xyz").write("hello")
        result, dom = run_and_parse(family=xunit_family)
        assert result.ret
        node = dom.find_first_by_tag("testsuite")
        node.assert_attr(errors=0, failures=1, skipped=0, tests=1)
        tnode = node.find_first_by_tag("testcase")
        tnode.assert_attr(name="myfile.xyz")
        fnode = tnode.find_first_by_tag("failure")
        fnode.assert_attr(message="custom item runtest failed")
        assert "custom item runtest failed" in fnode.toxml()

@pytest.mark.parametrize("junit_logging", ["no", "system-out"])
def test_nullbyte(testdir, junit_logging):
    # A null byte can not occur in XML (see section 2.2 of the spec)
    testdir.makepyfile(
        """
        import sys
        def test_print_nullbyte():
            sys.stdout.write('Here the null -->' + chr(0) + '<--')
            sys.stdout.write('In repr form -->' + repr(chr(0)) + '<--')
            assert False
    """
    )
    xmlf = testdir.tmpdir.join("junit.xml")
    testdir.runpytest("--junitxml=%s" % xmlf, "-o", "junit_logging=%s" % junit_logging)
    text = xmlf.read()
    assert "\x00" not in text
    if junit_logging == "system-out":
        assert "#x00" in text
    if junit_logging == "no":
        assert "#x00" not in text

@pytest.mark.parametrize("junit_logging", ["no", "system-out"])
def test_nullbyte_replace(testdir, junit_logging):
    # Check if the null byte gets replaced
    testdir.makepyfile(
        """
        import sys
        def test_print_nullbyte():
            sys.stdout.write('Here the null -->' + chr(0) + '<--')
            sys.stdout.write('In repr form -->' + repr(chr(0)) + '<--')
            assert False
    """
    )
    xmlf = testdir.tmpdir.join("junit.xml")
    testdir.runpytest("--junitxml=%s" % xmlf, "-o", "junit_logging=%s" % junit_logging)
    text = xmlf.read()
    if junit_logging == "system-out":
        assert "#x0" in text
    if junit_logging == "no":
        assert "#x0" not in text

def test_invalid_xml_escape():
    # Test some more invalid xml chars, the full range should be
    # tested really but let's just test the edges of the ranges
    # instead.
    # XXX This only tests low unicode character points for now as
    #     there are some issues with the testing infrastructure for
    #     the higher ones.
    # XXX Testing 0xD (\r) is tricky as it overwrites the just written
    #     line in the output, so we skip it too.
    invalid = (
        0x00,
        0x1,
        0xB,
        0xC,
        0xE,
        0x19,
        27,  # issue #126
        0xD800,
        0xDFFF,
        0xFFFE,
        0x0FFFF,
    )  # , 0x110000)
    valid = (0x9, 0xA, 0x20)
    # 0xD, 0xD7FF, 0xE000, 0xFFFD, 0x10000, 0x10FFFF)

    for i in invalid:
        got = bin_xml_escape(chr(i))
        if i <= 0xFF:
            expected = "#x%02X" % i
        else:
            expected = "#x%04X" % i
        assert got == expected
    for i in valid:
        assert chr(i) == bin_xml_escape(chr(i))

def test_logxml_path_expansion(tmpdir, monkeypatch):
    home_tilde = py.path.local(os.path.expanduser("~")).join("test.xml")
    xml_tilde = LogXML("~%stest.xml" % tmpdir.sep, None)
    assert xml_tilde.logfile == home_tilde

    monkeypatch.setenv("HOME", str(tmpdir))
    home_var = os.path.normpath(os.path.expandvars("$HOME/test.xml"))
    xml_var = LogXML("$HOME%stest.xml" % tmpdir.sep, None)
    assert xml_var.logfile == home_var

def test_logxml_changingdir(testdir):
    testdir.makepyfile(
        """
        def test_func():
            import os
            os.chdir("a")
    """
    )
    testdir.tmpdir.mkdir("a")
    result = testdir.runpytest("--junitxml=a/x.xml")
    assert result.ret == 0
    assert testdir.tmpdir.join("a/x.xml").check()

def test_logxml_makedir(testdir):
    """--junitxml should automatically create directories for the xml file"""
    testdir.makepyfile(
        """
        def test_pass():
            pass
    """
    )
    result = testdir.runpytest("--junitxml=path/to/results.xml")
    assert result.ret == 0
    assert testdir.tmpdir.join("path/to/results.xml").check()

def test_logxml_check_isdir(testdir):
    """Give an error if --junit-xml is a directory (#2089)"""
    result = testdir.runpytest("--junit-xml=.")
    result.stderr.fnmatch_lines(["*--junitxml must be a filename*"])

def test_escaped_parametrized_names_xml(testdir, run_and_parse):
    testdir.makepyfile(
        """\
        import pytest
        @pytest.mark.parametrize('char', ["\\x00"])
        def test_func(char):
            assert char
        """
    )
    result, dom = run_and_parse()
    assert result.ret == 0
    node = dom.find_first_by_tag("testcase")
    node.assert_attr(name="test_func[\\x00]")

def test_double_colon_split_function_issue469(testdir, run_and_parse):
    testdir.makepyfile(
        """
        import pytest
        @pytest.mark.parametrize('param', ["double::colon"])
        def test_func(param):
            pass
    """
    )
    result, dom = run_and_parse()
    assert result.ret == 0
    node = dom.find_first_by_tag("testcase")
    node.assert_attr(classname="test_double_colon_split_function_issue469")
    node.assert_attr(name="test_func[double::colon]")

def test_double_colon_split_method_issue469(testdir, run_and_parse):
    testdir.makepyfile(
        """
        import pytest
        class TestClass(object):
            @pytest.mark.parametrize('param', ["double::colon"])
            def test_func(self, param):
                pass
    """
    )
    result, dom = run_and_parse()
    assert result.ret == 0
    node = dom.find_first_by_tag("testcase")
    node.assert_attr(classname="test_double_colon_split_method_issue469.TestClass")
    node.assert_attr(name="test_func[double::colon]")

def test_unicode_issue368(testdir) -> None:
    path = testdir.tmpdir.join("test.xml")
    log = LogXML(str(path), None)
    ustr = "ВНИ!"

    class Report(BaseReport):
        longrepr = ustr
        sections = []  # type: List[Tuple[str, str]]
        nodeid = "something"
        location = "tests/filename.py", 42, "TestClass.method"

    test_report = cast(TestReport, Report())

    # hopefully this is not too brittle ...
    log.pytest_sessionstart()
    node_reporter = log._opentestcase(test_report)
    node_reporter.append_failure(test_report)
    node_reporter.append_collect_error(test_report)
    node_reporter.append_collect_skipped(test_report)
    node_reporter.append_error(test_report)
    test_report.longrepr = "filename", 1, ustr
    node_reporter.append_skipped(test_report)
    test_report.longrepr = "filename", 1, "Skipped: 卡嘣嘣"
    node_reporter.append_skipped(test_report)
    test_report.wasxfail = ustr  # type: ignore[attr-defined]
    node_reporter.append_skipped(test_report)
    log.pytest_sessionfinish()

def test_record_property(testdir, run_and_parse):
    testdir.makepyfile(
        """
        import pytest

        @pytest.fixture
        def other(record_property):
            record_property("bar", 1)
        def test_record(record_property, other):
            record_property("foo", "<1");
    """
    )
    result, dom = run_and_parse()
    node = dom.find_first_by_tag("testsuite")
    tnode = node.find_first_by_tag("testcase")
    psnode = tnode.find_first_by_tag("properties")
    pnodes = psnode.find_by_tag("property")
    pnodes[0].assert_attr(name="bar", value="1")
    pnodes[1].assert_attr(name="foo", value="<1")
    result.stdout.fnmatch_lines(["*= 1 passed in *"])

def test_record_property_same_name(testdir, run_and_parse):
    testdir.makepyfile(
        """
        def test_record_with_same_name(record_property):
            record_property("foo", "bar")
            record_property("foo", "baz")
    """
    )
    result, dom = run_and_parse()
    node = dom.find_first_by_tag("testsuite")
    tnode = node.find_first_by_tag("testcase")
    psnode = tnode.find_first_by_tag("properties")
    pnodes = psnode.find_by_tag("property")
    pnodes[0].assert_attr(name="foo", value="bar")
    pnodes[1].assert_attr(name="foo", value="baz")

@pytest.mark.parametrize("fixture_name", ["record_property", "record_xml_attribute"])
def test_record_fixtures_without_junitxml(testdir, fixture_name):
    testdir.makepyfile(
        """
        def test_record({fixture_name}):
            {fixture_name}("foo", "bar")
    """.format(
            fixture_name=fixture_name
        )
    )
    result = testdir.runpytest()
    assert result.ret == 0

@pytest.mark.filterwarnings("default")
def test_record_attribute(testdir, run_and_parse):
    testdir.makeini(
        """
        [pytest]
        junit_family = xunit1
    """
    )
    testdir.makepyfile(
        """
        import pytest

        @pytest.fixture
        def other(record_xml_attribute):
            record_xml_attribute("bar", 1)
        def test_record(record_xml_attribute, other):
            record_xml_attribute("foo", "<1");
    """
    )
    result, dom = run_and_parse()
    node = dom.find_first_by_tag("testsuite")
    tnode = node.find_first_by_tag("testcase")
    tnode.assert_attr(bar="1")
    tnode.assert_attr(foo="<1")
    result.stdout.fnmatch_lines(
        ["*test_record_attribute.py:6:*record_xml_attribute is an experimental feature"]
    )

@pytest.mark.filterwarnings("default")
@pytest.mark.parametrize("fixture_name", ["record_xml_attribute", "record_property"])
def test_record_fixtures_xunit2(testdir, fixture_name, run_and_parse):
    """Ensure record_xml_attribute and record_property drop values when outside of legacy family."""
    testdir.makeini(
        """
        [pytest]
        junit_family = xunit2
    """
    )
    testdir.makepyfile(
        """
        import pytest

        @pytest.fixture
        def other({fixture_name}):
            {fixture_name}("bar", 1)
        def test_record({fixture_name}, other):
            {fixture_name}("foo", "<1");
    """.format(
            fixture_name=fixture_name
        )
    )

    result, dom = run_and_parse(family=None)
    expected_lines = []
    if fixture_name == "record_xml_attribute":
        expected_lines.append(
            "*test_record_fixtures_xunit2.py:6:*record_xml_attribute is an experimental feature"
        )
    expected_lines = [
        "*test_record_fixtures_xunit2.py:6:*{fixture_name} is incompatible "
        "with junit_family 'xunit2' (use 'legacy' or 'xunit1')".format(
            fixture_name=fixture_name
        )
    ]
    result.stdout.fnmatch_lines(expected_lines)

def test_random_report_log_xdist(testdir, monkeypatch, run_and_parse):
    """`xdist` calls pytest_runtest_logreport as they are executed by the workers,
    with nodes from several nodes overlapping, so junitxml must cope with that
    to produce correct reports (#1064)."""
    pytest.importorskip("xdist")
    monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
    testdir.makepyfile(
        """
        import pytest, time
        @pytest.mark.parametrize('i', list(range(30)))
        def test_x(i):
            assert i != 22
    """
    )
    _, dom = run_and_parse("-n2")
    suite_node = dom.find_first_by_tag("testsuite")
    failed = []
    for case_node in suite_node.find_by_tag("testcase"):
        if case_node.find_first_by_tag("failure"):
            failed.append(case_node["name"])

    assert failed == ["test_x[22]"]

@parametrize_families
def test_root_testsuites_tag(testdir, run_and_parse, xunit_family):
    testdir.makepyfile(
        """
        def test_x():
            pass
    """
    )
    _, dom = run_and_parse(family=xunit_family)
    root = dom.get_unique_child
    assert root.tag == "testsuites"
    suite_node = root.get_unique_child
    assert suite_node.tag == "testsuite"

def test_runs_twice(testdir, run_and_parse):
    f = testdir.makepyfile(
        """
        def test_pass():
            pass
    """
    )

    result, dom = run_and_parse(f, f)
    result.stdout.no_fnmatch_line("*INTERNALERROR*")
    first, second = [x["classname"] for x in dom.find_by_tag("testcase")]
    assert first == second

def test_runs_twice_xdist(testdir, run_and_parse):
    pytest.importorskip("xdist")
    testdir.monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
    f = testdir.makepyfile(
        """
        def test_pass():
            pass
    """
    )

    result, dom = run_and_parse(f, "--dist", "each", "--tx", "2*popen")
    result.stdout.no_fnmatch_line("*INTERNALERROR*")
    first, second = [x["classname"] for x in dom.find_by_tag("testcase")]
    assert first == second

def test_fancy_items_regression(testdir, run_and_parse):
    # issue 1259
    testdir.makeconftest(
        """
        import pytest
        class FunItem(pytest.Item):
            def runtest(self):
                pass
        class NoFunItem(pytest.Item):
            def runtest(self):
                pass

        class FunCollector(pytest.File):
            def collect(self):
                return [
                    FunItem.from_parent(name='a', parent=self),
                    NoFunItem.from_parent(name='a', parent=self),
                    NoFunItem.from_parent(name='b', parent=self),
                ]

        def pytest_collect_file(path, parent):
            if path.check(ext='.py'):
                return FunCollector.from_parent(fspath=path, parent=parent)
    """
    )

    testdir.makepyfile(
        """
        def test_pass():
            pass
    """
    )

    result, dom = run_and_parse()

    result.stdout.no_fnmatch_line("*INTERNALERROR*")

    items = sorted("%(classname)s %(name)s" % x for x in dom.find_by_tag("testcase"))
    import pprint

    pprint.pprint(items)
    assert items == [
        "conftest a",
        "conftest a",
        "conftest b",
        "test_fancy_items_regression a",
        "test_fancy_items_regression a",
        "test_fancy_items_regression b",
        "test_fancy_items_regression test_pass",
    ]

@parametrize_families
def test_global_properties(testdir, xunit_family) -> None:
    path = testdir.tmpdir.join("test_global_properties.xml")
    log = LogXML(str(path), None, family=xunit_family)

    class Report(BaseReport):
        sections = []  # type: List[Tuple[str, str]]
        nodeid = "test_node_id"

    log.pytest_sessionstart()
    log.add_global_property("foo", "1")
    log.add_global_property("bar", "2")
    log.pytest_sessionfinish()

    dom = minidom.parse(str(path))

    properties = dom.getElementsByTagName("properties")

    assert properties.length == 1, "There must be one <properties> node"

    property_list = dom.getElementsByTagName("property")

    assert property_list.length == 2, "There most be only 2 property nodes"

    expected = {"foo": "1", "bar": "2"}
    actual = {}

    for p in property_list:
        k = str(p.getAttribute("name"))
        v = str(p.getAttribute("value"))
        actual[k] = v

    assert actual == expected

def test_url_property(testdir) -> None:
    test_url = "http://www.github.com/pytest-dev"
    path = testdir.tmpdir.join("test_url_property.xml")
    log = LogXML(str(path), None)

    class Report(BaseReport):
        longrepr = "FooBarBaz"
        sections = []  # type: List[Tuple[str, str]]
        nodeid = "something"
        location = "tests/filename.py", 42, "TestClass.method"
        url = test_url

    test_report = cast(TestReport, Report())

    log.pytest_sessionstart()
    node_reporter = log._opentestcase(test_report)
    node_reporter.append_failure(test_report)
    log.pytest_sessionfinish()

    test_case = minidom.parse(str(path)).getElementsByTagName("testcase")[0]

    assert (
        test_case.getAttribute("url") == test_url
    ), "The URL did not get written to the xml"

@parametrize_families
def test_record_testsuite_property(testdir, run_and_parse, xunit_family):
    testdir.makepyfile(
        """
        def test_func1(record_testsuite_property):
            record_testsuite_property("stats", "all good")

        def test_func2(record_testsuite_property):
            record_testsuite_property("stats", 10)
    """
    )
    result, dom = run_and_parse(family=xunit_family)
    assert result.ret == 0
    node = dom.find_first_by_tag("testsuite")
    properties_node = node.find_first_by_tag("properties")
    p1_node = properties_node.find_nth_by_tag("property", 0)
    p2_node = properties_node.find_nth_by_tag("property", 1)
    p1_node.assert_attr(name="stats", value="all good")
    p2_node.assert_attr(name="stats", value="10")

def test_record_testsuite_property_junit_disabled(testdir):
    testdir.makepyfile(
        """
        def test_func1(record_testsuite_property):
            record_testsuite_property("stats", "all good")
    """
    )
    result = testdir.runpytest()
    assert result.ret == 0

@pytest.mark.parametrize("junit", [True, False])
def test_record_testsuite_property_type_checking(testdir, junit):
    testdir.makepyfile(
        """
        def test_func1(record_testsuite_property):
            record_testsuite_property(1, 2)
    """
    )
    args = ("--junitxml=tests.xml",) if junit else ()
    result = testdir.runpytest(*args)
    assert result.ret == 1
    result.stdout.fnmatch_lines(
        ["*TypeError: name parameter needs to be a string, but int given"]
    )

@pytest.mark.parametrize("suite_name", ["my_suite", ""])
@parametrize_families
def test_set_suite_name(testdir, suite_name, run_and_parse, xunit_family):
    if suite_name:
        testdir.makeini(
            """
            [pytest]
            junit_suite_name={suite_name}
            junit_family={family}
        """.format(
                suite_name=suite_name, family=xunit_family
            )
        )
        expected = suite_name
    else:
        expected = "pytest"
    testdir.makepyfile(
        """
        import pytest

        def test_func():
            pass
    """
    )
    result, dom = run_and_parse(family=xunit_family)
    assert result.ret == 0
    node = dom.find_first_by_tag("testsuite")
    node.assert_attr(name=expected)

def test_escaped_skipreason_issue3533(testdir, run_and_parse):
    testdir.makepyfile(
        """
        import pytest
        @pytest.mark.skip(reason='1 <> 2')
        def test_skip():
            pass
    """
    )
    _, dom = run_and_parse()
    node = dom.find_first_by_tag("testcase")
    snode = node.find_first_by_tag("skipped")
    assert "1 <> 2" in snode.text
    snode.assert_attr(message="1 <> 2")

@parametrize_families
def test_logging_passing_tests_disabled_does_not_log_test_output(
    testdir, run_and_parse, xunit_family
):
    testdir.makeini(
        """
        [pytest]
        junit_log_passing_tests=False
        junit_logging=system-out
        junit_family={family}
    """.format(
            family=xunit_family
        )
    )
    testdir.makepyfile(
        """
        import pytest
        import logging
        import sys

        def test_func():
            sys.stdout.write('This is stdout')
            sys.stderr.write('This is stderr')
            logging.warning('hello')
    """
    )
    result, dom = run_and_parse(family=xunit_family)
    assert result.ret == 0
    node = dom.find_first_by_tag("testcase")
    assert len(node.find_by_tag("system-err")) == 0
    assert len(node.find_by_tag("system-out")) == 0

@parametrize_families
@pytest.mark.parametrize("junit_logging", ["no", "system-out", "system-err"])
def test_logging_passing_tests_disabled_logs_output_for_failing_test_issue5430(
    testdir, junit_logging, run_and_parse, xunit_family
):
    testdir.makeini(
        """
        [pytest]
        junit_log_passing_tests=False
        junit_family={family}
    """.format(
            family=xunit_family
        )
    )
    testdir.makepyfile(
        """
        import pytest
        import logging
        import sys

        def test_func():
            logging.warning('hello')
            assert 0
    """
    )
    result, dom = run_and_parse(
        "-o", "junit_logging=%s" % junit_logging, family=xunit_family
    )
    assert result.ret == 1
    node = dom.find_first_by_tag("testcase")
    if junit_logging == "system-out":
        assert len(node.find_by_tag("system-err")) == 0
        assert len(node.find_by_tag("system-out")) == 1
    elif junit_logging == "system-err":
        assert len(node.find_by_tag("system-err")) == 1
        assert len(node.find_by_tag("system-out")) == 0
    else:
        assert junit_logging == "no"
        assert len(node.find_by_tag("system-err")) == 0
        assert len(node.find_by_tag("system-out")) == 0

redpajama_set_name: RedPajamaGithub


Following the huge success of the Top 50 MLM Blogs 2009 and Top 50 MLM Blogs 2010, this year was the biggest one to date! The 137 Top MLM Bloggers who entered staged a diverse range of internet marketing strategies and social media campaigns to collectively gather 5,192 legitimate votes.
Although the vote count is a record in itself, the standing ovation goes out to the contestants who showed true determination and proved that they are amongst the industry's Top MLM Bloggers.
If you were lucky enough to be part of the buzz, excitement and got to witness these fine blog artists subtly persuade their audience to show their appreciation through votes, their is no denying that these bloggers walk the talk.
1) How to recruit more people, 2) How to overcome objections, 3) How to get more leads online & 4) How to get more traffic to your website. No matter what company you are in, his blog can help. He is also the #1 earner in his company & the #2 earner in MLSP. His blog is ranked under 16,000 worldwide on Alexa and he routinely leaks audios & videos from private events.
Mavis Nong created her blog to help people build successful businesses online. She shares fundamental, effective and cutting-edge strategies and tips that they can implement right away to grow their businesses. She also provides mind-blowing blogging tips to help others build amazing and money making blogs fast. Mavis went from not knowing anything about blogging to becoming a highly sought after blogging expert, raking in the cash using her blog, in less than 8 months.
Whether you are just starting in MLM or you are a seasoned veteran, Darren Little's MLM Superhero blog will give you the most important information you need to understand exactly what you need to do to get yourself branded as a leader in the MLM industry and get your phone ringing with incoming calls. How do you develop bullet proof belief in an industry where 97% of the people that try fail? Simple! Mindset, motivation, inspiration, systems and training and that's exactly what you'll find here.
Melodie Kantner is a successful full time network marketer with over 16 years of experience in the industry, 14 of those years have been with one company. Melodie was shy and uncomfortable with old school network marketing and sales but wanted a successful business so she set out to find ways to get people to call her. Melodie helps people learn down to earth network marketing skills, success mindset, personal development and techniques for releasing fears that are holding you back.
Marc Korn lives in New Jersey with his incredible wife and son. Marc is a Continuous Learning Advocate who understands the critical importance of Personal Development and MasterMinding.
Marc is all about adding value for his readers and offers quality content in many areas and disciplines of self improvement.
On Marc's blog, you will always find empowering videos by Personal Development Leaders, such as Brian Tracy along with many FREE, valuable gifts.
Visit NOW and Visit OFTEN.
April Marie Tucker's Online Network Marketing Training Blog has been a huge resource for all types of Online Marketers. The main focus of her Blog is to give the skill's and training needed for others to succeed with Online Network Marketing. April Marie's expertise is in Network Marketing, Video Marketing, Social Media, Blogging, Lead Generation and List Building. She was recently inducted into the Online Marketers Hall of Fame and is a Top Recruiter in her Primary Network Marketing Company.
Dr. Bob Clarke is a Part Time InterNetwork Marketer who understands the struggles faced by Part Time Marketers. His posts focus on how to be more productive with limited time, leveraging your skills and other people's resources to maximize your results, and finding the right mentors and coaches to reduce your learning curve. Dr Bob's pillar posts on building a highly popular blog Part Time were top rated. This blog is a Go To Resource for anyone building a business Part Time.
Natasha Nassar is an attorney, speaker, author and internet marketing coach dedicated to empowering fellow entrepreneurs to build a savvy personal brand online. Readers love Natasha's no-nonsense and humorous teaching style. Natasha is the author of the popular "The 10 Commandments of Building You, Inc." training series. Her blog ranked #13 in the 2010 Top 50 MLM Blogs. Natasha and her husband were recently featured as the spotlight members of their primary business opportunity.
Joey McDermott has been involved in the industry for 11 years now and has built multiple companies, and even consulted to help build other companies. He brings a wealth of knowledge from the sales industry, having over 20 years of sales experience he is teaching how to overcome objections, build relationships, and help you develop the right mindset to be successful in the Network Marketing and Direct Sales. He soon is releasing a cutting edge book and is negotiation deals to do infomercials.
Tracey Walker's Network Marketing Success Blog is one of the hot-est, freshest, energized blogs on the web in the niche of Network Marketing. Her brand is absolutely STUNNING, yet maintains class and professionalism all at the same time. Over the past 3 years, Tracey's blog has literally grown into a mainstream resource for network marketers looking for success strategies and tips on building their businesses online. In summary, Tracey Walker's Network Marketing Success Blog is the real deal!
VaNessa is a mom, wife, community activist and serial entrepreneur. She's passionate about empowering people to take control and action in their lives so they can have more time, money and satisfaction. On a daily basis she teaches about branding, blogging, social media and online and offline marketing techniques to entrepreneurs. After a 20 year career in Real Estate and Technology she found her passion blending her sales and marketing background in the affiliate and network marketing arenas.
So what does the "Blues" have to do with MLM? Well the blues is everywhere! Everyone has the blues sometime or another! You see the Bluesman's passion for playing the guitar is just as big as his passion for others succeeding! Playing an instrument takes time,consistency and commitment! Basically anyone and I mean anyone can learn how to play an instrument. But it takes commitment to succeed! That's the Bluesman's main focus! Mindset, the right training and leadership! Check out the Bluesman!
No matter what you set out to do in life, you've got to have some kind of a game plan. For Easther Sudharta, that game plan started coming together when she created her own SEO site called MyOnlineGamePlan.com. In her quest to learn the ins and outs of the Internet marketing business, she's found a few things that work and a few that don't. And now she's created a place where she can share all that information with the rest of the world.
Sandy Moore's Educating you in Internet Marketing blog, educates individuals and businesses in Attraction Marketing. Sandy specialises in Free Targeted Lead Generation, Article Marketing and her blog has been a much sought after resource for beginners and advanced Online Marketers. Since the beginning of 2010 Sandy has strategically placed herself as a leader in her primary business and runs several online Groups who call on her expertise for building their own online empires.
16 mos. ago, Michelle started in the network marketing industry. A complete rookie without a mentor, she had to learn things on her own. Through her hard work, dedication and persistence she was able to not only utilize, but master Facebook marketing to build a burgeoning 6 figure business. As the result of this success, Bill was able to quit his healthy 6 figure income career in corporate America and join Michelle to become one of the most dynamic couples in the internet marketing industry.
Jeffrey Kistner loves everything Network Marketing. Twenty years ago his life changed after being approached by an inexperienced consultant struggling to present a marketing concept he didn't know existed. Jeffrey loved the concept and asked to join the consultants business before they finished their presentation. Jeffrey is a great example of not being able to say the wrong thing to right person. Jeffrey is a mentor to many and continues to teach concepts, techniques and skills on and off line.
Nicky Price is a dedicated wife and Mom of two living in the UK. Sick of the hype on the internet, Nicky provides clarity in the world of internet and network marketing with simple but professional and easy to follow marketing strategies.
Nicky has regularly been featured in the Better Networker newsletters for her professional and sometimes humorous look at life as an Internet or Network Marketer and has authored her own "Facebook for Business Blueprint" and "7 Days to Success" e-books.
Stacia Hopkins is the founder of http://StaciaHopkins.com and creator of The Beginner's Guide To Video Marketing. She is an internet marketing consultant who assists business owners to build an online presence using video marketing strategies. She lives in Boise, Idaho, loves lacrosse and plays the viola. She gets out of bed every day because of her "why:" to empower others' ambition.
Marcin and Mari embarked on a journey to travel the world and generate income without being attached to one place. The first destination was The Maldives where they only had savings sufficient for 3 months only. So it was a combination of snorkelling, diving, fishing and figuring out how to generate income online.
Currently, Marcin and Mari have built their business in 17 different countries in 4 continents. The blog shares lessons & learnings that made it possible.
As one of the winners of the Top 50 MLM Blogs for 2010, Sonny Lanorias has continued to teach and train others to work online to match his online success. Sonny has been consistently making money from home since 2008 and is still considered by many as the # 1 internet entrepreneur in Davao City Philippines on the subject of Home Based Internet Marketing Business. He has also continued to generate thousands of leads on the Internet by using free and low cost methods even if he stays at the beach.
Authentic & Empowering! Sharon is indeed qualified to serve you with an extensive background in critical care nursing, personal growth & financial literacy and 10+yrs working with R & K Kiyosaki, attending all their business & investment programs. A busy WFH mom, her real estate portfolio = asset base, but her NWM biz allows financial freedom. From Gen S/Y to Baby Boomers, BiW blog is straight from the heart with crystalline insight, advice, coaching & leadership in NWM for your success. Drop by, connect and share with Sharon and her bus partner, Steve Partos!
Darren Spruyt is a network marketer from Singapore and he has been marketing his business online since 2008. However, Darren did not start off in this industry without any struggles. For 3 years, Darren did not take any action in his business as he had struggled with self-belief and how much value he could offer people. Fast forward, Darren was recently labeled as a "Dark Horse" in the magnetic sponsoring product launch and now blogs about mindset, MLM lead generation & Internet marketing.
"Rare and Refreshing, Just the Straight Talk". Terry Petrovick's student's learn about leadership, the how to's of cutting edge marketing and business development. Terry's strategies cover both online and offline methods. His message is powerful, direct, and honest with no frills or false promises. Terry's journey began with his son climbing into Terry's lap and asked, "Dad, do you still love me?" For Terry it is all about family and showing people how to create a better quality of life. Vote http://TerryPetrovick.com as one of the Top MLM Blogs.
Clint Butler is a recovering internet marketer turned network marketer looking to provide excellent value and information to help other network marketers and people new to network marketing online succeed. Using search engine optimization and social media marketing techniques to build traffic to your site and brand yourself as a leader no matter what product or service that you promote.
John Robberson wears many hats. By day he wears the hat of a Rabid Criminal Defense Attorney zealously defending his clients. By night he wears the hat of a Rebel Network Marketer who's blog posts provide tips, techniques and the solutions to Network Marketer;s problems.
His posts range the whole gamut of Internet Marketing and MLM from Article Marketing, Lead Creation, SEO and Recruiting Tactics.
Dave and Dawn Cook are the Founders of Tribe Syndication Association (TSA), TSAmastery, http://daveanddawncoook.com and many other sites that have helped numerous people over the years. Throughout the years, they have given a lot of their time and experience helping others build more Exposure, more Relationships and much more Success! When others in this industry try to figure out what's in it for them, Dave and Dawn have always gave first and has changed the lives of so many for the better.
Suzanne has considerable offline business experience and extensive online marketing skill sets, she is assisting people with their online business goals, branding and setup. She is passionate about leading people to success. Suzanne has the great ability to motivate others helping them with their mindset and personal growth. Her mission is to simplify the dreary process of building a successful online business, and to empower people to change their life circumstances.
Lynda Cromar is a dreamer extraordinare!
She has been a resident of Colorado all of her life and enjoys a rich family life there. She is a veteran network marketer, and has brought team work successful to her own team. She typically stays on the leader board of anything that she gets involved in. She is a trainer and teacher, in her blog she shares her expertise and her down-to-earth-style of leadership specializing in tools and training and using social media to build a successful MLM.
In 1990, due to a few bad decisions, Rob Fore lost everything. His home, business, income and self-respect. He went from hero to homeless in 90 days. Today Rob uses the internet to "Create Wealth on the Fast Track" and invites you to join him on the journey. He teaches a proven 5-step system for generating organic search traffic, leads and sales. He is a top 20 income earner with a team of over 11,000 active MLM distributors worldwide, a certified firewalk instructor, public speaker and coach.
Viviana believes that attraction marketing starts from YOU. She helps people to discover their rich potential through coaching. The key success in network marketing business is personal development. Success is attracted by the person you become. She is a member of coaching cognition and she is implementing marketing funnel for her network marketing business. She encourages people to use attraction marketing training from her website to generate endless leads for network marketing success.
John is a business and marketing coach who helps entrepreneurs grow their business so that they can make more money and have more free time. His unique ability to develop customers has helped his clients create a successful business and a solid six figure income. He developed his blog to provide entrepreneurs a way to learn about the various marketing strategies needed to grow their business bigger and faster then ever before.
Angela was inspired at a young age to become an entrepreneur. It was like it was wired in her as she was always the one trying to start a lemonade stand or a restaurant in her parents basement. As she grew up that passion turned into a business online. She is a firm believer in living a life by design and going after big dreams. She shares the tools she has found to design her life and make an income from home.
Janet's blog provides 100% original value based content including strategies, tips and personal development coaching for direct seller's, network marketer's. Janet's unique blend of 10+ years in direct sales/network marketing field sales- corporate leadership with global direct sales companies UK/USA helping entrepreneurs in network marketing prospect, recruit, train & develop and achieve their goals and dreams. Janet is passionate about helping you achieve your personal success.
Ruth Alade is a stay at home mum turned internet/network marketer whose passion is helping women [and of course men 🙂 ] to escape the rat race. She's been online for 11 months and some of her key achievements includes being featured in Magnetic Sponsoring twice for affiliate sales of their products. Ruth loves blogging and is an SEO gal as well. Ruth has 2 young kids, a lovely husband and she loves traveling.
Neil Ashworth is a former PRO Soccer player, marathon running entrepreneur who has turned the tables on what most believe is the right way to build a business online. Neil teaches a practical approach to marketing and creates systems that anyone can follow to build a profitable and fun business from home. If you're sick of the hype and want to learn exactly what it takes to make money from home take a look at Neil Ashworth's network marketing blog.
The Network Dad is a freedom fighter for all new and seasoned bloggers. A gateway to a new form of energy and social proof also knows as tribe syndication. With the birth of a the personal branding blog, bloggers everywhere have formed tribes or groups of people who come together and form a giving relationship of helping each other. People helping people by sharing each others content is what The Network Dad is all about.
James Bennett is a home business advocate, blog author, direct marketer, and a personal development teacher.
He writes about personal achievement, the law of success, financial IQ, mastermind groups, home business, and direct marketing.
Jerry Chen is one of the few who mastered both online and offline marketing in the industry. As a marketer, consultant and friend to many in the industry Jerry brings exceptional value and track record to the table. Overcoming challenges isn't new to him as he went from a broke, 16 year-old immigrant speaking 1st grade English to network marketing superstar in just a few short years. His blog Build A Magnetic Network is one of a kind combining leadership, marketing and exclusive interviews.
Aidan Gibson has combined his experience in the MLM and internet marketing industry to help people become more aware of living a more eco friendly lifestyle, one step at a time. He shares tips on being more green and offers the opportunity to become part of the unique dedicated green home based business revolution. Wikaniko (We Can Eco) shows people simple steps towards a more eco way of living.
Soak in some tips to help your business go to the next level, helping others to create success and leadership. This is what helps us not to give up. Alecia Stringer's A Success Dream Blog has a huge resource for all types of Online Marketers. The main focus of her Blog is to give the skill's and training needed for others to succeed with Online Network Marketing. Alecia Stringer's expertise is in Video Marketing, Social Media, Blogging, Lead Generation and List Building.
Raena Lynn is an entrepreneur who specializes in helping new marketers by "Helping You Move Forward With Internet Marketing. Her goals are to help people gain freedom. Her blog includes Internet Marketing, Attraction Marketing, Social Media, Personal Development, Blogging, Affiliate Marketing, Leadership, Mindset, and Product Creation. Vote http://raenalynn.com as one of the Top MLM Blogs.
She has attended Unstoppable Entrepreneur, Unstoppable Millionaire, and The Ultimate Game of Life.
Trevor Barrett has been around plenty of years to experience many ups and downs inf life. He has been rich and he has been very poor but he knows which he prefers best. A couple of years ago, when the hard times began to hit the world he had to become the money advice expert for his family. He realized the mistakes he had made by not putting money aside for retirement or a rainy day. He decided to blog to help other people both save money and make money to avoid the pitfalls that he came across.
Steve Hawk (aka The No Hype Networker) is a full-time network marketer who works out of his house in NY. His writing style is refreshing in an industry known to contain a bit of "hype" – straight forward and to the point. His posts and videos include marketing techniques and training to help network marketers learn different strategies they can use to grow their own business. Steve's true area of expertise is driving targeted search engine traffic to his blog and converting it into leads.
Donna Merrill guides you through the maze of personal development techniques that will make you excel in your online business, MLM enterprise or anything else you have dedicated your talents to.
Yorinda Wanner has a passion for inspiring people towards Self – Empowerment with posts and providing Life Coaching.
Having overcome many challenges in her own life she is keen to pass on what has helped her.
Personal Development and mental, emotional and physical health are her favorite subjects.
She also provides tools to do this as well as tips and tricks to establish one self on the internet.
Miriam has graduate level training in educational psychology. She teaches psychological principles and emotional triggers as applied to home and small business development, sales, advertisements, mobile marketing, networking and social media world. Mindset and personal growth has been a focus in her personal and professional training. Miriam is passionate about leading people to attain and maintain success using mindset strategies that inspire and enhance at a personal and professional level.
Joyce lives in Elgin, Illinois with her dog Zippy and Zippy's 3 cats. She has been in the healthcare field for over 35 years in both western and eastern medicine. She is passionate about guiding people through the maze of healthcare that have become so much more complicated to the average person. Telling stories and keeping up with news stories, she uses her easy to read style to inform and enlighten people who are looking for help when it comes to their health.
Edward is a husband and father from London Ontario Canada!
Serial Entrepreneur and Founder of a Multi-Million Dollar Technology Company (EK3.com).
Has a Passion for Empowering People to Live the Life of Their Dreams.
Loving the MLM and Network Marketing Profession.
John Gaydon spent the first 15 years of his working life moving up the corporate ladder. The second phase of his life was participating in and conducting many Personal development courses. At the end of 1997, he started his third attempt at Network Marketing, and has been involved every since. It is now his main source of income and has been since 2002. John Moved on line in 2005, and Now offers a wide range of ways to find MLM customers on line.
Wow thank you so much George and MLSP for all you did with this contest! I really learned a lot and I agree the recognition and experience gained, alone is priceless! Such a amazing experience this has been! Thanks again!
Congratulations everhone! All well deserved and I can't imagine a more esteemed group of bloggers for 2011 !
Congratulations to all of you! I couldn't imagine a more esteemed and respected group for 2011. Keep up the great work – just watch out in 2012!!
A HUGE CONGRATULATIONS to everyone who placed in the TOP 50 MLM BlOGS CONTEST and to anyone who particpated. I think I can say for all of us that we are grateful for every person who took the time to vote for our blogs. Thanks to George Fourie for running an engaging, fun and honest contest. I learned so much by participating in this contest and I feel that the top bloggers have presented fantastic models others to follow for their marketing efforts and future contests. I pat all of us on the back for showing great leadership and professionalism. I feel truly humbled to have made this list among some of the best of the best blogs on the internet. Thank you.
Well done Raena, great effort from you!
Great Job on your Top 50 MLM blog contest! You stepped it up a notch this year It seems to have been a major success.
You should be very proud of your efforts in helping so many get even more exposure! We here at TSA appreciate all your hard work and wish you even more success in the years to come!
Congratulations to all of the winners! Just out of curiosity, do you have the rankings for all of the entrants, or just the top 50?
Hey Steve, yes it's there but probably not something that will be released. Can tell you that their are many shared positions on the same amount of votes as the list goes down.
Wow!! Awesome! Thanks for hosting and putting in so many hours to sift through all the votes. I appreciate you!
Congrats to All the winners !!
Thanks for your leadership here too George, and for what you do for our industry.
Hey Brian! Thanks for stopping by, much appreciate the support and thanks for sponsoring the Top 50 MLM Blogs for 2011! The buzz and votes DOUBLED from last year and that's thanks to MLSP. On a side note, I picked up tons of great tips through Roxana (she rocks btw) who is a walking billboard for the leadership and values of MLSP. I now clearly see why you guys are the top in the industry 🙂 Thanks again!
Thank you so much for all of your hard work in presenting the 2011 TOP 50 MLM Blogs. You have done a tremendous job and as a participant, I was honored to be a part of the event.
Thanks to MLSP for sponsoring this year and congratulations to the TOP 50 Bloggers and to ALL who were a part of this great contest. I hope all will be back again next year.
Weldone .Congrate to All Top Winnwers.


text:
PlayStation 4, PlayStation 5, Xbox One, Xbox Series X, Nintendo Switch, Windows
Teenage Mutant Ninja Turtles: The Cowabunga Collection is a compilation of classic Teenage Mutant Ninja Turtles games. It includes:
Teenage Mutant Ninja Turtles (arcade)
Teenage Mutant Ninja Turtles: Turtles in Time (arcade)
Teenage Mutant Ninja Turtles (NES)
Teenage Mutant Ninja Turtles II: The Arcade Game (NES)
Teenage Mutant Ninja Turtles III: The Manhattan Project (NES)
Teenage Mutant Ninja Turtles: Tournament Fighters (NES)
Teenage Mutant Ninja Turtles IV: Turtles in Time (SNES)
Teenage Mutant Ninja Turtles: Tournament Fighters (SNES)
Teenage Mutant Ninja Turtles: The Hyperstone Heist (Sega Genesis)
Teenage Mutant Ninja Turtles: Tournament Fighters (Sega Genesis)
Teenage Mutant Ninja Turtles: Fall of the Foot Clan (Game Boy)
Teenage Mutant Ninja Turtles II: Back from the Sewers (Game Boy)
Teenage Mutant Ninja Turtles III: Radical Rescue (Game Boy)
view · editTeenage Mutant Ninja Turtles series
Fall of the Foot Clan
Manhattan Missions
The Manhattan Project
Back from the Sewers
Turtles in Time
The Hyperstone Heist
Radical Rescue
Tournament Fighters
Shredder's Revenge
Teenage Mutant Ninja Turtles (Game Boy Advance)
Teenage Mutant Ninja Turtles (2003)
2: Battle Nexus
3: Mutant Nightmare
Mutant Melee
Fast Forward: Ninja Training NYC
Power of 4
Teenage Mutant Ninja Turtles (Xbox)
Teenage Mutant Ninja Turtles: Smash-Up
Mutants in Manhattan
Compilation(s):
The Cowabunga Collection
Retrieved from "https://strategywiki.org/w/index.php?title=Teenage_Mutant_Ninja_Turtles:_The_Cowabunga_Collection&oldid=982371"

redpajama_set_name: RedPajamaCommonCrawl