testcontainers / testcontainers/testcontainers-python

TypeError: object.__new__() takes exactly one argument (the type to instantiate)

オープン
#401 コメント 21 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

👀 requires attention 🔀 requires triage
主要言語
Python
スター
2.3k
フォーク
386
平均マージ
4時間 40分
マージ済み PR(30日)
1

説明

Describe the bug

running testcontainers in a pytest using a with statement I get the following error

@wait_container_is_ready()
def _connect(self) -> MongoClient:
  return MongoClient(self.get_connection_url())

E TypeError: object.new() takes exactly one argument (the type to instantiate)

Just wondering if anyone else has encountered this

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、レポートに示されている with 文と MongoClient 呼び出しを使って、pytest で失敗を再現します。wait_container_is_ready() デコレーターと接続経路を追跡し、object.new() が誤った引数を受け取る理由を特定します。報告されたシナリオで TypeError が発生しなくなり、リグレッションテストが追加されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, mongodb, python
領域
databases, testing
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。